-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (127 loc) · 3.79 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
concurrency: ci-${{ github.ref }}
on:
push:
tags-ignore:
- "*"
branches:
- "main"
pull_request:
release:
types: [published]
workflow_dispatch:
env:
REPOSITORY: ${{ github.repository }}
jobs:
# generate-docs:
# runs-on: ubuntu-20.04
# if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
# steps:
# - name: trigger docs update in sum.golang.org and pkg.go.dev
# uses: essentialkaos/godoc-action@v1
static-analysis:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.4
- uses: actions/cache@v4
id: go-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: go vet check
run: make vet-check
- name: go fmt check
run: make fmt-check
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.63.4
skip-cache: true
args: "--timeout=3m"
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23.4
- uses: actions/cache@v4
id: go-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: test
run: make test-coverage
# - name: install goveralls
# run: go install github.com/mattn/goveralls@latest
# - name: send coverage
# env:
# COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: goveralls -coverprofile=covprofile -service=github
build-static-binary:
runs-on: ubuntu-20.04
needs: [static-analysis, test]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: 1.23.4
- uses: actions/cache@v4
id: go-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: build
run: make -j4 cross-compiled
- name: compress
run: |
set -x
find ./build -maxdepth 1 -mindepth 1 -type d -exec sh -c 'tar -zcf build/workbench-$(basename {}).tgz -C {} workbench' \;
- uses: actions/upload-artifact@v4
with:
name: workbench-binaries
path: |
build/workbench-amd64.tgz
build/workbench-arm64.tgz
release-rolling:
needs: [build-static-binary]
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v4
with:
name: workbench-binaries
- uses: "marvinpinto/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "rolling"
prerelease: true
title: "Cutting Edge"
files: |
workbench-amd64.tgz
workbench-arm64.tgz
# This job doesn't actually make release, but rather reacts to a manual one, made via the GitHub UI.
# In the future, we might want to reuse the same mechanism of the rolling ones to automate everything here as well.
release-tag:
needs: [build-static-binary]
if: github.event.release
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v4
with:
name: workbench-binaries
- uses: AButler/[email protected]
with:
files: "workbench-*"
repo-token: ${{ secrets.GITHUB_TOKEN }}