fix(deps): update module github.com/urfave/cli/v3 to v3.11.0 #560
This file contains hidden or 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: QA & sanity checks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| go-sanity: | |
| name: "Go: Code sanity" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Go code sanity check | |
| uses: canonical/desktop-engineering/gh-actions/go/code-sanity@main | |
| with: | |
| golangci-lint-configfile: ".golangci.yaml" | |
| tools-directory: "tools" | |
| govulncheck: "false" | |
| go-tests: | |
| name: "Go: Tests" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: ["coverage", "race"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install gotestfmt and our wrapper script | |
| uses: canonical/desktop-engineering/gh-actions/go/gotestfmt@main | |
| - name: Install coverage collection dependencies | |
| if: matrix.test == 'coverage' | |
| run: | | |
| set -eu | |
| go install -C tools github.com/AlekSi/gocov-xml | |
| go install -C tools github.com/axw/gocov/gocov | |
| dotnet tool install -g dotnet-reportgenerator-globaltool | |
| - name: Prepare tests artifacts path | |
| run: | | |
| set -eu | |
| artifacts_dir=$(mktemp -d --tmpdir tpmctl-test-artifacts-XXXXXX) | |
| echo TPMCTL_TEST_ARTIFACTS_DIR="${artifacts_dir}" >> $GITHUB_ENV | |
| - name: Run tests (with coverage collection) | |
| if: matrix.test == 'coverage' | |
| run: | | |
| set -euo pipefail | |
| # The coverage is not written if the output directory does not exist, so we need to create it. | |
| cov_dir=${PWD}/coverage | |
| raw_cov_dir=${cov_dir}/raw_files | |
| codecov_dir=${cov_dir}/codecov | |
| mkdir -p "${raw_cov_dir}" "${codecov_dir}" | |
| set -x | |
| go test -json -cover -covermode=set ./... -shuffle=on -args -test.gocoverdir="${raw_cov_dir}" 2>&1 | \ | |
| gotestfmt --logfile "${TPMCTL_TEST_ARTIFACTS_DIR}/gotestfmt.cover.log" | |
| go tool covdata textfmt -i="${raw_cov_dir}" -o="${cov_dir}/coverage.out" | |
| grep -v -e "testutils" "${cov_dir}/coverage.out" >"${cov_dir}/coverage.out.filtered" | |
| gocov convert "${cov_dir}/coverage.out.filtered" | gocov-xml > "${cov_dir}/coverage.xml" | |
| reportgenerator -reports:"${cov_dir}/coverage.xml" -targetdir:"${codecov_dir}" -reporttypes:Cobertura | |
| echo COVERAGE_DIR="${codecov_dir}" >> ${GITHUB_ENV} | |
| - name: Run tests (with race detector) | |
| if: matrix.test == 'race' | |
| run: | | |
| go test -json -race ./... | \ | |
| gotestfmt --logfile "${TPMCTL_TEST_ARTIFACTS_DIR}/gotestfmt.race.log" | |
| - name: Upload coverage to Codecov | |
| if: matrix.test == 'coverage' | |
| uses: codecov/codecov-action@v6 | |
| with: | |
| directory: ${{ env.COVERAGE_DIR }} | |
| files: ${{ env.COVERAGE_DIR }}/Cobertura.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload coverage report as artifact | |
| if: matrix.test == 'coverage' && github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: coverage | |
| path: ${{ env.COVERAGE_DIR }} | |
| - name: Upload test artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: tpmctl-${{ github.job }}-${{ matrix.test }}-artifacts-${{ github.run_attempt }} | |
| path: ${{ env.TPMCTL_TEST_ARTIFACTS_DIR }} |