Reorganise CI #223
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
- devel | |
pull_request: | |
env: | |
GO111MODULE: on | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
go: [ '1.20' ] | |
name: ${{ matrix.os }} @ Go ${{ matrix.go }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go ${{ matrix.go }} | |
uses: actions/setup-go@v1 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Set environment | |
run: | | |
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV | |
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install Dependencies | |
run: | | |
go get -v github.com/golang/mock/mockgen@v1.4.4 | |
- name: Generate mock file | |
run: go generate -v ./... | |
- name: Lint source code | |
run: go vet -v ./... | |
- name: Run Tests | |
run: go test -race --coverprofile=coverage.coverprofile --covermode=atomic -v ./... | |
- name: Update go report card | |
if: success() && matrix.os == 'ubuntu-latest' | |
continue-on-error: true | |
uses: creekorful/goreportcard-action@v1.0 |