deps: updates to go 1.22 #153
Workflow file for this run
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` value will appear "as is" in the badge. | |
# See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository | |
# yamllint --format github .github/workflows/commit.yaml | |
--- | |
name: "build" | |
on: | |
push: # We run tests on non-tagged pushes to master | |
tags: '' | |
branches: master | |
paths-ignore: | |
- '**/*.md' | |
pull_request: # We also run tests on pull requests targeted at the master branch. | |
branches: master | |
paths-ignore: | |
- '**/*.md' | |
# workflow_dispatch will let us manually trigger the workflow from GitHub actions dashboard. | |
# For example, you can try to build a branch without raising a pull request. | |
# See https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/manually-running-a-workflow | |
workflow_dispatch: | |
defaults: | |
run: # use bash for all operating systems unless overridden | |
shell: bash | |
jobs: | |
test: | |
name: "${{ matrix.os }}, go${{ matrix.go-version }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # don't fail fast as sometimes failures are operating system specific | |
matrix: | |
os: [ubuntu-22.04, macos-12] | |
go-version: | |
- "1.22" # Current Go version | |
- "1.21" # Floor Go version of car (current - 1) | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: false # not cache: true as we also need to cache golint | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build | |
~/.cache/golangci-lint | |
~/go/pkg/mod | |
~/go/bin | |
key: check-${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum', 'Makefile') }} | |
- name: "Verify clean check-in" | |
run: make check | |
- name: "Run unit tests" | |
run: make test | |
- name: "Generate coverage report" # only once (not per OS) | |
if: runner.os == 'Linux' | |
run: make coverage | |
- name: "Upload coverage report" # only on master push and only once (not per OS) | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && runner.os == 'Linux' | |
uses: codecov/codecov-action@v2 | |
with: | |
file: ./coverage.txt |