-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (68 loc) · 1.8 KB
/
ci.yml
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
68
on: [ push, pull_request ]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.20.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4.1.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Generate env file
run: 'echo "$ENV_FILE" > cmd/env'
shell: bash
env:
ENV_FILE: ${{secrets.ENV}}
- name: Generate env.test file
run: 'echo "$ENV_TEST_FILE" > cmd/env.test'
shell: bash
env:
ENV_TEST_FILE: ${{secrets.ENV_TEST}}
- name: Install Task
uses: arduino/setup-task@v1.0.3
with:
version: 3.20.0
- name: Test
run: task test
- name: Upload report to Codecov
uses: codecov/codecov-action@v3
with:
verbose: true
files: coverage.txt
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4.1.0
with:
go-version: 1.20.0
- uses: actions/checkout@v4
- name: Generate env file
run: 'echo "$ENV_FILE" > cmd/env'
shell: bash
env:
ENV_FILE: ${{secrets.ENV}}
- name: Generate env.test file
run: 'echo "$ENV_TEST_FILE" > cmd/env.test'
shell: bash
env:
ENV_TEST_FILE: ${{secrets.ENV_TEST}}
- name: Install Task
uses: arduino/setup-task@v1.0.3
with:
version: 3.20.0
- name: Generate code
run: task generate
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
with:
version: v1.51.0
skip-pkg-cache: true
skip-go-installation: true
skip-build-cache: true