forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 231
171 lines (150 loc) · 4.54 KB
/
downstream-project-spl.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Downstream Project - SPL
on:
push:
branches:
- master
- v[0-9]+.[0-9]+
pull_request:
branches:
- master
- v[0-9]+.[0-9]+
paths:
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"
- "cargo-build-sbf"
- "cargo-test-sbf"
- "ci/downstream-projects/run-spl.sh"
- ".github/workflows/downstream-project-spl.yml"
- ".github/scripts/downstream-project-spl-common.sh"
- ".github/scripts/downstream-project-spl-install-deps.sh"
workflow_call:
inputs:
branch:
required: false
type: string
default: "master"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- shell: bash
run: |
.github/scripts/purge-ubuntu-runner.sh
- uses: mozilla-actions/[email protected]
with:
version: "v0.8.1"
- shell: bash
run: |
source .github/scripts/downstream-project-spl-install-deps.sh
source .github/scripts/downstream-project-spl-common.sh
if [ -n "$SKIP_SPL_DOWNSTREAM_PROJECT_TEST" ]; then
exit 0
fi
cargo check
test:
runs-on: ubuntu-latest
strategy:
matrix:
arrays:
[
{
test_paths: ["token/cli"],
required_programs:
[
"token/program",
"token/program-2022",
"associated-token-account/program",
"instruction-padding/program",
],
},
{
test_paths: ["single-pool/cli"],
required_programs:
[
"single-pool/program",
],
},
{
test_paths: ["token-upgrade/cli"],
required_programs:
[
"token-upgrade/program",
],
},
]
steps:
- uses: actions/checkout@v4
- shell: bash
run: |
.github/scripts/purge-ubuntu-runner.sh
- uses: mozilla-actions/[email protected]
with:
version: "v0.8.1"
- shell: bash
run: |
source .github/scripts/downstream-project-spl-install-deps.sh
source .github/scripts/downstream-project-spl-common.sh
if [ -n "$SKIP_SPL_DOWNSTREAM_PROJECT_TEST" ]; then
exit 0
fi
programStr="${{ tojson(matrix.arrays.required_programs) }}"
IFS=', ' read -ra programs <<<"${programStr//[\[\]$'\n'$'\r' ]/}"
for program in "${programs[@]}"; do
$CARGO_BUILD_SBF --manifest-path "$program"/Cargo.toml
done
testPathsStr="${{ tojson(matrix.arrays.test_paths) }}"
IFS=', ' read -ra test_paths <<<"${testPathsStr//[\[\]$'\n'$'\r' ]/}"
for test_path in "${test_paths[@]}"; do
cargo test --manifest-path "$test_path"/Cargo.toml
done
cargo-test-sbf:
runs-on: ubuntu-latest
strategy:
matrix:
programs:
- [token/program]
- [
instruction-padding/program,
token/program-2022,
token/program-2022-test,
]
- [
associated-token-account/program,
associated-token-account/program-test,
]
- [token-upgrade/program]
- [feature-proposal/program]
- [governance/addin-mock/program, governance/program]
- [memo/program]
- [name-service/program]
- [stake-pool/program]
- [single-pool/program]
steps:
- uses: actions/checkout@v4
- shell: bash
run: |
.github/scripts/purge-ubuntu-runner.sh
- uses: mozilla-actions/[email protected]
with:
version: "v0.8.1"
- shell: bash
run: |
source .github/scripts/downstream-project-spl-install-deps.sh
source .github/scripts/downstream-project-spl-common.sh
if [ -n "$SKIP_SPL_DOWNSTREAM_PROJECT_TEST" ]; then
exit 0
fi
programStr="${{ tojson(matrix.programs) }}"
IFS=', ' read -ra programs <<<"${programStr//[\[\]$'\n'$'\r' ]/}"
for program in "${programs[@]}"; do
$CARGO_TEST_SBF --manifest-path "$program"/Cargo.toml
done