Merge pull request #276 from cri-o/dependabot/github_actions/actions-… #606
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: test | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v* | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
name: Build / ${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: | |
- amd64 | |
- arm64 | |
- s390x | |
- mips64le | |
- ppc64le | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: go.mod | |
- name: Build on ${{ matrix.arch }} | |
run: make GOARCH=${{ matrix.arch }} | |
test-linux: | |
name: Run tests on Linux amd64 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: go.mod | |
- name: Install test binaries | |
run: | | |
go install github.com/modocache/gover@latest | |
go install github.com/mattn/goveralls@latest | |
- name: test | |
run: PATH=$PATH:$(go env GOPATH)/bin COVERALLS=1 make check | |
- name: Send coverage to coveralls | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin | |
gover | |
goveralls -coverprofile=gover.coverprofile -service=github | |
lint: | |
name: Run golangci-lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: go.mod | |
- run: make lint |