fix(pkg): disable log styling for tests. #145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- name: Build | |
run: make build | |
- name: Test | |
run: make test | |
gomodtidy: | |
name: Enforce go.mod tidiness | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 | |
with: | |
ref: "${{ github.event.pull_request.head.sha }}" | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
persist-credentials: false | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: 'go.mod' | |
- name: Execute go mod tidy and check the outcome | |
working-directory: ./ | |
run: | | |
go mod tidy | |
exit_code=$(git diff --exit-code) | |
exit ${exit_code} | |
- name: Print a comment in case of failure | |
run: | | |
echo "The go.mod and/or go.sum files appear not to be correctly tidied. | |
Please, rerun go mod tidy to fix the issues." | |
exit 1 | |
if: | | |
failure() && github.event.pull_request.head.repo.full_name == github.repository |