-
Notifications
You must be signed in to change notification settings - Fork 4.4k
162 lines (141 loc) · 4.1 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
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-bpf"
- "cargo-test-bpf"
- "cargo-build-sbf"
- "cargo-test-sbf"
- "ci/downstream-projects/run-spl.sh"
- ".github/workflows/downstream-project-spl.yml"
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:
if: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- shell: bash
run: |
.github/scripts/purge-ubuntu-runner.sh
- uses: mozilla-actions/sccache-action@v0.0.3
with:
version: "v0.5.4"
- shell: bash
run: |
source .github/scripts/downstream-project-spl-common.sh
source .github/scripts/downstream-project-spl-install-deps.sh
cargo check
test:
if: false
runs-on: ubuntu-latest
strategy:
matrix:
arrays:
[
{
test_paths: ["token/cli"],
required_programs:
[
"token/program",
"token/program-2022",
"associated-token-account/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@v3
- shell: bash
run: |
.github/scripts/purge-ubuntu-runner.sh
- uses: mozilla-actions/sccache-action@v0.0.3
with:
version: "v0.5.4"
- shell: bash
run: |
source .github/scripts/downstream-project-spl-common.sh
source .github/scripts/downstream-project-spl-install-deps.sh
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@v3
- shell: bash
run: |
.github/scripts/purge-ubuntu-runner.sh
- uses: mozilla-actions/sccache-action@v0.0.3
with:
version: "v0.5.4"
- shell: bash
run: |
source .github/scripts/downstream-project-spl-common.sh
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