-
Notifications
You must be signed in to change notification settings - Fork 27
92 lines (88 loc) · 2.55 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 'CI'
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.6.0
with:
version: latest
args: --enable gofumpt
test:
runs-on: ${{ matrix.os }}
needs: [ lint ]
permissions:
checks: write
pull-requests: write
actions: read
contents: read
security-events: write
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- if: ${{ matrix.os == 'ubuntu-latest' }}
uses: docker/login-action@v2
with:
registry: registry.jetbrains.team
username: ${{ secrets.SPACE_USERNAME }}
password: ${{ secrets.SPACE_PASSWORD }}
- run: go test -v ./... -coverprofile cover.out
env:
QODANA_TOKEN: ${{ secrets.TEST_QODANA_TOKEN }}
- if: startsWith(matrix.os, 'ubuntu')
uses: JetBrains/qodana-action@main
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
- if: startsWith(matrix.os, 'ubuntu')
uses: github/codeql-action/init@v2
with:
languages: go
- if: startsWith(matrix.os, 'ubuntu')
uses: github/codeql-action/autobuild@v2
- if: startsWith(matrix.os, 'ubuntu')
uses: github/codeql-action/analyze@v2
package:
needs: [ lint, test ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: 1.19
- name: install chocolatey
run: |
mkdir -p /opt/chocolatey
wget -q -O - "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar -xz -C "/opt/chocolatey"
echo '#!/bin/bash' >> /usr/local/bin/choco
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco
chmod +x /usr/local/bin/choco
env:
CHOCOLATEY_VERSION: 1.2.0
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: --snapshot --clean --debug
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
install-script-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
./install