-
Notifications
You must be signed in to change notification settings - Fork 62
66 lines (64 loc) · 1.85 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (64 loc) · 1.85 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
name: build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['tip', '1.27', '1.26', '1.25', '1.24', '1.23', '1.22']
steps:
- uses: actions/checkout@v4
- name: Setup Go
if: matrix.go-version != 'tip'
uses: actions/setup-go@master
with:
go-version: ${{ matrix.go-version }}
- name: Setup Go tip if needed
if: matrix.go-version == 'tip'
run: |
set -ex
curl --head https://github.com/phuslu/go/releases/download/v0.0.0/gotip.linux-amd64.tar.xz
sleep 1
curl -LOJ https://github.com/phuslu/go/releases/download/v0.0.0/gotip.linux-amd64.tar.xz
rm -rf /usr/local/go
sudo tar xJf gotip.linux-amd64.tar.xz -C /usr/local
sudo ln -sf /usr/local/go/bin/go /usr/bin/go
go version
- name: Build
run: go build -v -race
- name: Test
run: go test -v
- name: Bench
run: go test -v -run=none -bench=.
gccgo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@master
with:
# gccgo's libgo is based on go1.18, while go1.26+ generates a test main
# that libgo's testing/internal/testdeps cannot compile.
go-version: '1.25'
- name: Setup gccgo
run: |
sudo apt-get update
sudo apt-get install -y gccgo
- name: Build
run: go build -v -compiler=gccgo
- name: Test
run: go test -v -compiler=gccgo
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60