This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 55
70 lines (69 loc) · 2 KB
/
ci.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
65
66
67
68
69
70
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.21' ]
link:
- type: dynamic
goflags: ""
- type: static
# On Ubuntu, libxml2 is compiled with GCC and is linked to libicu, which introduces a
# stealth dependency on libstdc++ at link-time
goflags: "-ldflags '-extldflags -lstdc++' -tags 'osusergo netgo static_build'"
name: "Test [ Go ${{ matrix.go }}, ${{ matrix.link.type }} linking ]"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
~/.cache/bazel
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go stable version
if: matrix.go != 'tip'
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Run Go tests
run: go test -race ${{ matrix.link.goflags }} ./...
- name: Test linking capability
run: |
go build -o linktest ${{ matrix.link.goflags }} ./test/link
file linktest | grep '${{ matrix.link.type }}ally linked'
archlinux:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.21' ]
container:
image: archlinux:latest
name: "Test [ Arch Linux + Go ${{ matrix.go }} ]"
steps:
- uses: actions/checkout@v3
- name: Set Up Arch Linux
run: |
pacman -Syy --noconfirm
pacman -Syu --noconfirm
pacman -S --noconfirm base-devel
pacman -S --noconfirm libxml2=2.12.7
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Test
run: go test ./...