Skip to content

Commit

Permalink
Create common.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
simlecode authored Apr 10, 2024
1 parent 0177f30 commit c00085f
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build and golangci-lint and test

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
check:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: true

- name: install default deps
run: sudo apt-get -o Acquire::Retries=3 update && sudo apt-get -o Acquire::Retries=3 install make ftp git bzr curl wget -y

- name: Build
env:
GOPROXY: "https://proxy.golang.org,direct"
GO111MODULE: "on"
run: |
make
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
golangci-lint run --timeout 10m
- name: Detect changes
run: |
go mod tidy
git status --porcelain
test -z "$(git status --porcelain)"
- name: Run coverage
run: |
go test -coverpkg=./... -race -coverprofile=coverage.txt -covermode=atomic ./... -v --timeout 10m
- name: Upload
uses: codecov/codecov-action@v2
with:
files: ./coverage.txt
flags: unittests
name: venus-messager
verbose: true

0 comments on commit c00085f

Please sign in to comment.