-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (52 loc) · 1.25 KB
/
go.yml
File metadata and controls
62 lines (52 loc) · 1.25 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
name: Go CI
on:
push:
branches: [ main ]
paths:
- 'go/**'
- 'rust/**'
- '.github/workflows/go.yml'
pull_request:
branches: [ main ]
paths:
- 'go/**'
- 'rust/**'
- '.github/workflows/go.yml'
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-go-build
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: rust
- name: Build Rust FFI library
run: cargo build --release
working-directory: rust
- name: Build Go bindings
run: go build ./...
working-directory: go
env:
CGO_ENABLED: 1
- name: Run unit tests
run: go test -v ./... 2>&1 | tee test-output.txt
working-directory: go
env:
CGO_ENABLED: 1
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: go-test-results
path: go/test-output.txt
retention-days: 5