-
Notifications
You must be signed in to change notification settings - Fork 367
149 lines (119 loc) · 4.07 KB
/
Copy pathdocs-examples.yml
File metadata and controls
149 lines (119 loc) · 4.07 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
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
name: Docs examples
on:
push:
branches: [main]
paths:
- "packages/docs-examples/**"
- "apps/docs/content/cookbook/**"
- ".github/workflows/docs-examples.yml"
pull_request:
branches: [main]
paths:
- "packages/docs-examples/**"
- "apps/docs/content/cookbook/**"
- ".github/workflows/docs-examples.yml"
env:
NODE_OPTIONS: --max-old-space-size=8192
SURFPOOL_REF: 88e9333b
jobs:
examples-ts:
name: TypeScript examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.15.1
run_install: false
- uses: actions/setup-node@v4
with:
node-version: "24"
cache: "pnpm"
- name: Cache Solana CLI
id: solana-cache
uses: actions/cache@v4
with:
path: ~/.local/share/solana/install
key: solana-cli-stable-${{ runner.os }}-v1
- name: Install Solana CLI
if: steps.solana-cache.outputs.cache-hit != 'true'
run: sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
- name: Add Solana CLI to PATH
run:
echo "$HOME/.local/share/solana/install/active_release/bin" >>
"$GITHUB_PATH"
- name: Verify solana-keygen
run: solana-keygen --version
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run docs-examples tests
run: pnpm --filter @workspace/docs-examples test
- name: Lint
run: pnpm --filter @workspace/docs-examples lint
examples-rust:
name: Rust examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: packages/docs-examples
- name: Cache surfpool binary
id: surfpool-cache
uses: actions/cache@v4
with:
path: ~/.cargo/bin/surfpool
key: surfpool-${{ runner.os }}-${{ env.SURFPOOL_REF }}
- name: Install surfpool
if: steps.surfpool-cache.outputs.cache-hit != 'true'
run:
cargo install --git https://github.com/txtx/surfpool --rev ${{
env.SURFPOOL_REF }} --locked surfpool-cli
- uses: actions/setup-node@v4
with:
node-version: "24"
- name: cargo check
working-directory: packages/docs-examples
run: cargo check --workspace
- name: Run every Rust example against surfpool
run: bash packages/docs-examples/scripts/run-rust-examples.sh
examples-python:
name: Python examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache surfpool binary
id: surfpool-cache
uses: actions/cache@v4
with:
path: ~/.cargo/bin/surfpool
key: surfpool-${{ runner.os }}-${{ env.SURFPOOL_REF }}
- name: Install surfpool
if: steps.surfpool-cache.outputs.cache-hit != 'true'
run:
cargo install --git https://github.com/txtx/surfpool --rev ${{
env.SURFPOOL_REF }} --locked surfpool-cli
- name: Cache Solana CLI
id: solana-cache
uses: actions/cache@v4
with:
path: ~/.local/share/solana/install
key: solana-cli-stable-${{ runner.os }}-v1
- name: Install Solana CLI
if: steps.solana-cache.outputs.cache-hit != 'true'
run: sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"
- name: Add Solana CLI to PATH
run:
echo "$HOME/.local/share/solana/install/active_release/bin" >>
"$GITHUB_PATH"
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: packages/docs-examples/requirements.txt
- name: Install Python deps
run: pip install -r packages/docs-examples/requirements.txt
- name: Run every Python example against surfpool
run: bash packages/docs-examples/scripts/run-python-examples.sh