-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.16 KB
/
ci.yml
File metadata and controls
52 lines (44 loc) · 1.16 KB
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
name: CI
on:
push:
branches: [ main ]
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: gofmt
uses: Jerome1337/gofmt-action@v1.0.4
with:
gofmt-path: './'
gofmt-flags: '-l -d -s -e'
- name: go vet
run: go vet ./...
- name: go test
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
files: ./coverage.txt
fail_ci_if_error: true
verbose: true
- name: Read new version
id: read_code_step
run: echo "::set-output name=code_version::$(.github/getCodeVersion.sh)"
- name: Create new version Tag
uses: actions/github-script@v5
env:
TAG_NAME: ${{steps.read_code_step.outputs.code_version}}
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/v${process.env.TAG_NAME}`,
sha: context.sha
})