forked from megaease/easeprobe
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 1.71 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI
on: [push,pull_request]
env:
GO_VERSION: 1.18
jobs:
license:
name: License Checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Check License Lines
uses: kt3k/[email protected]
lint:
name: Code Lint
runs-on: ubuntu-latest
steps:
- name: Setup Go Environment
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Checkout Source Code
uses: actions/checkout@v3
# https://github.com/reviewdog/reviewdog/issues/1158
# Permissions need to match container user
- name: "Give Permissions"
run: |
sudo chown -R root $GITHUB_WORKSPACE
- name: Spelling Check
uses: reviewdog/[email protected]
- name: Revive Action
uses: morphy2k/[email protected]
- name: "Restore Permissions"
run: |
sudo chown -R $(id -u) $GITHUB_WORKSPACE
- name: Check formatting
run: test -z $(gofmt -l .) || (gofmt -l . && exit 1)
test:
name: Unit Testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Setup Go Environment
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Go Get dependencies
run: go get -v -t -d ./...
- name: Go Test
run: make test TEST_FLAGS="-coverprofile=coverage.txt -covermode=atomic"
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
file: ./coverage.txt