-
Notifications
You must be signed in to change notification settings - Fork 194
117 lines (97 loc) · 2.84 KB
/
ci.yml
File metadata and controls
117 lines (97 loc) · 2.84 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: ci
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
basic:
name: basic checks (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
defaults:
run:
working-directory: v2
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
cache: true
cache-dependency-path: v2/go.sum
- name: Download dependencies
run: go mod download
- name: Test
run: go test -count=1 ./...
- name: Vet
run: go vet ./...
- name: Build packages
run: go build ./...
go111-build:
name: Go 1.11 compatibility build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go for vendoring
uses: actions/setup-go@v5
with:
go-version: '1.24.x'
cache: true
cache-dependency-path: v2/go.sum
- name: Prepare Go 1.11 vendor tree
shell: bash
run: |
set -euo pipefail
export GO111MODULE=on
export GOPATH="${RUNNER_TEMP}/go111-gopath"
src="${GOPATH}/src/github.com/chainreactors/gogo/v2"
mkdir -p "$(dirname "${src}")"
# NOTE: cmd/tinygo is excluded — it targets the TinyGo compiler (build
# tag 'tinygo') and imports github.com/chainreactors/rem/x/netdev, which
# is unrelated to the Go 1.11 WindowsXP build (root package + forceposix)
# and is not present in the public rem module. Excluding it keeps
# 'go mod vendor' from resolving that import. tinygo is tracked separately.
rsync -a --delete \
--exclude '.git' \
--exclude '.claude' \
--exclude '.tmp' \
--exclude '.toolchain' \
--exclude 'dist' \
--exclude 'vendor' \
--exclude '*.exe' \
--exclude 'cmd/tinygo' \
v2/ "${src}/"
cd "${src}"
go mod vendor
- name: Set up Go 1.11
uses: actions/setup-go@v5
with:
go-version: '1.11.13'
- name: Build Windows 386 binary with Go 1.11
shell: bash
run: |
set -euo pipefail
export GOPATH="${RUNNER_TEMP}/go111-gopath"
cd "${GOPATH}/src/github.com/chainreactors/gogo/v2"
mkdir -p dist
GO111MODULE=off \
GOOS=windows \
GOARCH=386 \
CGO_ENABLED=0 \
go build -o dist/gogo_windowsxp_386.exe -tags="forceposix goregexp" .