Repository navigation
91 lines (75 loc) · 1.98 KB
/
Copy pathgo.yml
File metadata and controls
91 lines (75 loc) · 1.98 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
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
name: Go
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-and-test:
name: Build and test
strategy:
matrix:
runner: [macos-14, ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.runner }}
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.26'
- uses: actions/checkout@v4
- name: Download libraries
run: go generate ./...
- name: Set library environment variables
run: |
echo "LIBRARY_PATH=$(pwd)/lib:$LIBRARY_PATH" >> $GITHUB_ENV
if [ "$RUNNER_OS" == "Linux" ]; then
echo "LD_LIBRARY_PATH=$(pwd)/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "DYLD_LIBRARY_PATH=$(pwd)/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
fi
- name: Build
run: go build -v
- name: Test
run: go test -v
- name: Run example
working-directory: example
run: go run main.go
build-and-test-windows:
name: Build and test (Windows)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
GOROOT: /ucrt64/lib/go
GOPATH: /ucrt64
steps:
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
update: true
msystem: UCRT64
install: >-
git
mingw-w64-ucrt-x86_64-go
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-openssl
unzip
- uses: actions/checkout@v4
- name: Download libraries
run: go generate ./...
- name: Set library environment variables
run: |
echo "LIBRARY_PATH=$(pwd)/lib:$LIBRARY_PATH" >> $GITHUB_ENV
- name: Build
run: go build -v
- name: Test
run: |
export PATH="$(pwd)/lib:$PATH"
go test -v
- name: Run example
run: |
export PATH="$(pwd)/lib:$PATH"
cd example
go run main.go