-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.67 KB
/
go.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
name: Go
on: [push]
permissions:
contents: write
jobs:
test-and-stuff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: debug
run: |
echo "matrix.os: ${{ matrix.os }}"
echo "Event name: ${{ github.event_name }}"
echo "Ref_name: ${{ github.ref_name }}"
echo "def branch: ${{ github.event.repository.default_branch }}"
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Test with the Go CLI
run: go test -short -v ./...
- name: Report Card
uses: creekorful/[email protected]
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
with:
report: true
chart: true
amend: true
reuse-go: true
if: |
github.event_name == 'push' &&
github.ref_name == github.event.repository.default_branch
continue-on-error: true
make-releases:
if: github.ref == 'refs/heads/main'
needs: test-and-stuff
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
arch: [x64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build release
run: go build -o aicli-${{ matrix.os }}-${{ matrix.arch }} ./cmd/aicli
- name: Upload release artifact
uses: actions/upload-artifact@v3
with:
name: aicli-${{ matrix.os }}-${{ matrix.arch }}
path: aicli-${{ matrix.os }}-${{ matrix.arch }}