Skip to content

Merge pull request #302 from yyforyongyu/update-gomod #239

Merge pull request #302 from yyforyongyu/update-gomod

Merge pull request #302 from yyforyongyu/update-gomod #239

Workflow file for this run

name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "*"
defaults:
run:
shell: bash
env:
GOCACHE: /home/runner/work/go/pkg/build
GOPATH: /home/runner/work/go
GO_VERSION: 1.19.x
jobs:
########################
# compilation check
########################
rpc-check:
name: RPC and mobile compilation check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'
- name: run check
run: make build
########################
# lint code
########################
lint:
name: lint code
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v2
with:
# The same as "git fetch --unshallow" but also works when running the
# action locally with "act".
fetch-depth: 0
- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'
- name: lint
run: make lint
########################
# run unit tests
########################
unit-test:
name: run unit tests
runs-on: ubuntu-latest
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
matrix:
unit_type:
- unit-cover
- unit-race
steps:
- name: git checkout
uses: actions/checkout@v2
- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'
- name: run ${{ matrix.unit_type }}
run: make ${{ matrix.unit_type }}
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
if: matrix.unit_type == 'unit-cover'
with:
path-to-profile: coverage.txt
parallel: true