-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (73 loc) · 2.27 KB
/
Copy pathci.yml
File metadata and controls
88 lines (73 loc) · 2.27 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
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Go test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Download modules
run: go mod download
- name: Verify dependency graph
run: |
go list -m all | tee modules.txt
! grep -E '=>|00010101000000|000000000000' modules.txt
- name: Run tests (L1 root module)
run: go test -timeout 20m ./...
- name: Run tests (L2 gogo)
run: cd gogo && go test -timeout 20m ./...
- name: Run tests (L2 spray)
run: cd spray && go test -timeout 20m ./...
- name: Run tests (L2 zombie)
run: cd zombie && go test -timeout 20m ./...
consumer-build:
name: External consumer build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Build a clean consumer module
shell: bash
run: |
tmp="$(mktemp -d)"
cd "$tmp"
go mod init sdk-consumer
cat > main.go <<'EOF'
package main
import (
_ "github.com/chainreactors/sdk/fingers"
_ "github.com/chainreactors/sdk/gogo"
_ "github.com/chainreactors/sdk/neutron"
_ "github.com/chainreactors/sdk/proton"
_ "github.com/chainreactors/sdk/spray"
_ "github.com/chainreactors/sdk/zombie"
)
func main() {}
EOF
go mod edit -require=github.com/chainreactors/sdk@v0.0.0
go mod edit -replace=github.com/chainreactors/sdk="$GITHUB_WORKSPACE"
go mod edit -replace=github.com/chainreactors/sdk/gogo="$GITHUB_WORKSPACE/gogo"
go mod edit -replace=github.com/chainreactors/sdk/spray="$GITHUB_WORKSPACE/spray"
go mod edit -replace=github.com/chainreactors/sdk/zombie="$GITHUB_WORKSPACE/zombie"
go mod tidy
go build .