-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (82 loc) · 2.32 KB
/
ci.yml
File metadata and controls
89 lines (82 loc) · 2.32 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions: {}
jobs:
versions:
runs-on: ubuntu-latest
outputs:
tools: ${{ steps.mise.outputs.tools }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- uses: yshrsmz/action-mise-values@92f49c5a07ebc7ffa957be5efa6a2c673578bbb0
id: mise
lint:
needs: versions
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- &checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- &setup-go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff
with:
go-version: ${{ fromJson(needs.versions.outputs.tools).go }}
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20
with:
version: v${{ fromJson(needs.versions.outputs.tools).golangci-lint }}
test:
needs: versions
environment: test
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- *checkout
- &setup-mise
uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151
- name: Test
run: mise run test
- name: Coverage
run: mise run covercheck
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: [versions, lint, test]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- *checkout
- *setup-go
- *setup-mise
- name: Build
run: mise run build
release:
runs-on: ubuntu-latest
needs: [versions, build]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
fetch-depth: 0
- *setup-go
- uses: go-semantic-release/action@2e9dc4247a6004f8377781bef4cb9dad273a741f
with:
allow-initial-development-versions: true
hooks: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}