-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 1.46 KB
/
test.yml
File metadata and controls
51 lines (49 loc) · 1.46 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
on:
push:
branches:
- main
pull_request:
name: Test
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Test
run: go test $(go list ./... | grep -v '/gen$') -coverprofile coverage.out
- name: Report coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
name: ${{ join(matrix.*, ' ') }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build binaries
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --snapshot --skip=publish --skip=snapcraft --skip=validate --clean --verbose
- name: Tar binaries to preserve executable bit
run: 'tar -cvf commitizen-binaries.tar --directory dist/ $(find dist/ -executable -type f -printf "%P\0" | xargs --null)'
- name: Upload binaries as artifacts
uses: actions/upload-artifact@v4
with:
name: Executables
path: commitizen-binaries.tar