Make version check run as best effort #598
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: build-and-test | |
on: | |
push: | |
branches: [main] | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+*" | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
setup-environment: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Cache Go | |
id: go-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/bin | |
~/go/pkg/mod | |
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Install dependencies | |
if: steps.go-cache.outputs.cache-hit != 'true' | |
run: make mod-update | |
- name: Install Tools | |
if: steps.go-cache.outputs.cache-hit != 'true' | |
run: make install-tools | |
lint: | |
runs-on: ubuntu-latest | |
needs: [setup-environment] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Cache Go | |
id: go-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/bin | |
~/go/pkg/mod | |
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Go Lint | |
run: make -j2 lint | |
- name: Go Impi | |
run: make go-impi | |
unittest: | |
strategy: | |
matrix: | |
go-version: ['1.20'] | |
runs-on: ubuntu-latest | |
needs: [setup-environment] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Cache Go | |
id: go-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/bin | |
~/go/pkg/mod | |
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Cache Build | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/go-build | |
key: unittest-${{ runner.os }}-go-build-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | |
- name: Go tests with coverage | |
run: make test-with-cover | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.txt | |
fail_ci_if_error: false #true | |
verbose: true | |
build: | |
needs: [setup-environment] | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Cache Go | |
id: go-cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/go/bin | |
~/go/pkg/mod | |
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
- name: Build | |
run: | | |
make build |