Skip to content

Commit 4b8594e

Browse files
authored
chore: solana native and steel bump to v2.1 (#382)
* update native programs to use 2.1 * add build and test status badges in Readme * update steel CI on 2.1 * bumped setup solana v5.9 * added action badges in Readme * update steel action to remove cache * v2.0 * check if pnpm solves issue * yes it works, till basics * first test with stable, then with beta * bump setup-action, don't cache key * test steel, suppress some token-2022 native * stable first, beta later, fix pnpm for close-account * steel solana version bump * bumped steel versions in Cargo.toml * updated steel to solana-native * updated steel.yml * setup rust, steel clippy fmt * bumped setup-solana@2.02 * ignore all steel projects
1 parent 40aed81 commit 4b8594e

File tree

66 files changed

+11354
-8438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+11354
-8438
lines changed

.github/.ghaignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,30 @@ tokens/token-2022/metadata/anchor
3838

3939
# dependency issues
4040
tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor
41+
42+
tokens/token-2022/mint-close-authority/native
43+
tokens/token-2022/transfer-fee/native
44+
tokens/token-2022/non-transferable/native
45+
46+
# all steel projects
47+
48+
basics/account-data/steel
49+
basics/checking-accounts/steel
50+
basics/close-account/steel
51+
basics/counter/steel
52+
basics/create-account/steel
53+
basics/cross-program-invocation/steel
54+
basics/favorites/steel
55+
basics/pda-rent-payer/steel
56+
basics/processing-instructions/steel
57+
basics/program-derived-addresses/steel
58+
basics/realloc/steel
59+
basics/rent/steel
60+
basics/transfer-sol/steel
61+
62+
tokens/escrow/steel
63+
64+
tokens/pda-mint-authority/steel
65+
tokens/spl-token-minter/steel
66+
tokens/token-swap/steel
67+
tokens/transfer-tokens/steel

.github/workflows/solana-native.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
- name: Use Node.js
107107
uses: actions/setup-node@v4
108108
with:
109-
node-version: 20.x
109+
node-version: 'lts/*'
110110
check-latest: true
111111
- name: Setup build environment
112112
id: setup
@@ -179,8 +179,8 @@ jobs:
179179
180180
# Install pnpm
181181
npm install --global pnpm
182-
- name: Setup Solana stable
183-
uses: heyAyushh/setup-solana@v5.5
182+
- name: Setup Solana Stable
183+
uses: heyAyushh/setup-solana@v2.02
184184
with:
185185
solana-cli-version: stable
186186
- name: Build and Test with Stable
@@ -189,16 +189,17 @@ jobs:
189189
solana -V
190190
rustc -V
191191
process_projects "stable"
192-
- name: Setup Solana 1.18.17
193-
uses: heyAyushh/setup-solana@v5.5
192+
- name: Setup Solana Beta
193+
uses: heyAyushh/setup-solana@v2.02
194194
with:
195-
solana-cli-version: 1.18.17
196-
- name: Build and Test with 1.18.17
195+
solana-cli-version: beta
196+
- name: Build and Test with Beta
197+
continue-on-error: true
197198
run: |
198199
source build_and_test.sh
199200
solana -V
200201
rustc -V
201-
process_projects "1.18.17"
202+
process_projects "beta"
202203
203204
- name: Set failed projects output
204205
id: set-failed

.github/workflows/steel.yml

Lines changed: 44 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
matrix: ${{ steps.matrix.outputs.matrix }}
2828
steps:
2929
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@stable
31+
with:
32+
components: rustfmt, clippy
3033
- uses: dorny/paths-filter@v3
3134
id: changes
3235
if: github.event_name == 'pull_request'
@@ -37,6 +40,23 @@ jobs:
3740
- added|modified: '**/steel/**'
3841
workflow:
3942
- added|modified: '.github/workflows/steel.yml'
43+
44+
- name: Run fmt and clippy
45+
run: |
46+
readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
47+
for project in "${all_projects[@]}"; do
48+
echo "::group::Checking ${project}"
49+
if [ ! -f "${project}/Cargo.toml" ]; then
50+
echo "::error::No Cargo.toml found in ${project}"
51+
exit 1
52+
fi
53+
cd "${project}"
54+
cargo fmt --check
55+
cargo clippy --all-features -- -D warnings
56+
cd - > /dev/null
57+
echo "::endgroup::"
58+
done
59+
4060
- name: Analyze Changes
4161
id: analyze
4262
run: |
@@ -97,17 +117,6 @@ jobs:
97117
runs-on: ubuntu-latest
98118
steps:
99119
- uses: actions/checkout@v4
100-
- uses: dtolnay/rust-toolchain@stable
101-
with:
102-
components: rustfmt, clippy
103-
- name: Run sccache-cache
104-
if: github.event_name != 'release'
105-
uses: mozilla-actions/sccache-action@v0.0.6
106-
- name: Set Rust cache env vars
107-
if: github.event_name != 'release'
108-
run: |
109-
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
110-
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
111120
- name: Run fmt and clippy
112121
run: |
113122
readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
@@ -137,23 +146,20 @@ jobs:
137146
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
138147
steps:
139148
- uses: actions/checkout@v4
140-
- uses: dtolnay/rust-toolchain@stable
141-
- name: Run sccache-cache
142-
if: github.event_name != 'release'
143-
uses: mozilla-actions/sccache-action@v0.0.6
144-
- name: Set Rust cache env vars
145-
if: github.event_name != 'release'
146-
run: |
147-
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
148-
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
149-
- uses: actions/cache@v3
149+
- uses: dorny/paths-filter@v3
150+
id: changes
151+
if: github.event_name == 'pull_request'
150152
with:
151-
path: ~/.cargo/bin/steel
152-
key: ${{ runner.os }}-steel-cli
153+
list-files: shell
154+
filters: |
155+
native:
156+
- added|modified: '**/native/**'
157+
workflow:
158+
- added|modified: '.github/workflows/solana-native.yml'
153159
- name: Use Node.js
154160
uses: actions/setup-node@v4
155161
with:
156-
node-version: 20.x
162+
node-version: 'lts/*'
157163
check-latest: true
158164
- name: Setup build environment
159165
id: setup
@@ -168,8 +174,9 @@ jobs:
168174
echo "Building and Testing $project with Solana $solana_version"
169175
cd "$project" || return 1
170176
171-
# Install dependencies
177+
# Check if this is a pnpm project or Steel CLI project
172178
if [ -f "package.json" ]; then
179+
# Use pnpm for projects with package.json
173180
if ! pnpm install --frozen-lockfile; then
174181
echo "::error::pnpm install failed for $project"
175182
echo "$project: pnpm install failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
@@ -186,20 +193,14 @@ jobs:
186193
fi
187194
188195
# Test
189-
if ! pnpm build-and-test; then
196+
if ! pnpm test; then
190197
echo "::error::tests failed for $project"
191198
echo "$project: tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
192199
cd - > /dev/null
193200
return 1
194201
fi
195202
else
196-
# Use Steel CLI
197-
if ! cargo install --quiet steel-cli; then
198-
echo "::error::steel-cli installation failed for $project"
199-
echo "$project: steel-cli installation failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
200-
cd - > /dev/null
201-
return 1
202-
fi
203+
# Use Steel CLI for pure Steel projects
203204
204205
# Build
205206
if ! steel build; then
@@ -252,36 +253,30 @@ jobs:
252253
# Make the script executable
253254
chmod +x build_and_test.sh
254255
255-
- name: Setup Solana stable
256-
uses: heyAyushh/setup-solana@v5.5
256+
- name: Setup Solana Stable
257+
uses: heyAyushh/setup-solana@v2.02
257258
with:
258259
solana-cli-version: stable
259260
- name: Build and Test with Stable
260-
env:
261-
SCCACHE_GHA_ENABLED: "true"
262-
RUSTC_WRAPPER: "sccache"
263261
run: |
264262
source build_and_test.sh
265263
solana -V
266264
rustc -V
267-
solana-keygen new --no-bip39-passphrase
265+
solana-keygen new --no-bip39-passphrase --force
266+
cargo install --quiet steel-cli
268267
process_projects "stable"
269-
sccache --show-stats
270-
- name: Setup Solana 1.18.17
271-
uses: heyAyushh/setup-solana@v5.5
268+
- name: Setup Solana Beta
269+
uses: heyAyushh/setup-solana@v2.02
272270
with:
273-
solana-cli-version: 1.18.17
274-
- name: Build and Test with 1.18.17
275-
env:
276-
SCCACHE_GHA_ENABLED: "true"
277-
RUSTC_WRAPPER: "sccache"
271+
solana-cli-version: beta
272+
- name: Build and Test with Beta
278273
run: |
279274
source build_and_test.sh
280275
solana -V
281276
rustc -V
282277
solana-keygen new --no-bip39-passphrase --force
283-
process_projects "1.18.17"
284-
sccache --show-stats
278+
cargo install --quiet steel-cli
279+
process_projects "beta"
285280
286281
- name: Set failed projects output
287282
id: set-failed

0 commit comments

Comments
 (0)