fix tests on mac arm64 (version 0.10 of resticprofile wasn't built fo… #113
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: Build | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
go_version: ['1.21', '1.22'] | |
os: [ubuntu-latest, windows-latest, macos-14] | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go ${{ matrix.go_version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go_version }} | |
check-latest: true | |
cache: true | |
- name: Get dependencies | |
run: | | |
go mod download | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
shell: bash | |
run: | | |
if [[ "${GITHUB_TOKEN}" != "" ]]; then | |
go test -v -race -coverprofile=coverage.txt . ./update | |
else | |
go test -v -race -short -coverprofile=coverage.txt . ./update | |
fi | |
- name: Code coverage with codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
env_vars: OS,GO | |
file: ./coverage.txt | |
flags: unittests | |
fail_ci_if_error: false | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} |