You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bathyscaphe/.github/workflows/ci.yml

54 lines
1.2 KiB
YAML

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