Skip to content

solana native and steel bump to v2.0 #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/.ghaignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,30 @@ tokens/token-2022/metadata/anchor

# dependency issues
tokens/token-2022/nft-meta-data-pointer/anchor-example/anchor

tokens/token-2022/mint-close-authority/native
tokens/token-2022/transfer-fee/native
tokens/token-2022/non-transferable/native

# all steel projects

basics/account-data/steel
basics/checking-accounts/steel
basics/close-account/steel
basics/counter/steel
basics/create-account/steel
basics/cross-program-invocation/steel
basics/favorites/steel
basics/pda-rent-payer/steel
basics/processing-instructions/steel
basics/program-derived-addresses/steel
basics/realloc/steel
basics/rent/steel
basics/transfer-sol/steel

tokens/escrow/steel

tokens/pda-mint-authority/steel
tokens/spl-token-minter/steel
tokens/token-swap/steel
tokens/transfer-tokens/steel
17 changes: 9 additions & 8 deletions .github/workflows/solana-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 'lts/*'
check-latest: true
- name: Setup build environment
id: setup
Expand Down Expand Up @@ -179,8 +179,8 @@ jobs:

# Install pnpm
npm install --global pnpm
- name: Setup Solana stable
uses: heyAyushh/setup-solana@v5.5
- name: Setup Solana Stable
uses: heyAyushh/setup-solana@v2.02
with:
solana-cli-version: stable
- name: Build and Test with Stable
Expand All @@ -189,16 +189,17 @@ jobs:
solana -V
rustc -V
process_projects "stable"
- name: Setup Solana 1.18.17
uses: heyAyushh/setup-solana@v5.5
- name: Setup Solana Beta
uses: heyAyushh/setup-solana@v2.02
with:
solana-cli-version: 1.18.17
- name: Build and Test with 1.18.17
solana-cli-version: beta
- name: Build and Test with Beta
continue-on-error: true
run: |
source build_and_test.sh
solana -V
rustc -V
process_projects "1.18.17"
process_projects "beta"

- name: Set failed projects output
id: set-failed
Expand Down
93 changes: 44 additions & 49 deletions .github/workflows/steel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: dorny/paths-filter@v3
id: changes
if: github.event_name == 'pull_request'
Expand All @@ -37,6 +40,23 @@ jobs:
- added|modified: '**/steel/**'
workflow:
- added|modified: '.github/workflows/steel.yml'

- name: Run fmt and clippy
run: |
readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
for project in "${all_projects[@]}"; do
echo "::group::Checking ${project}"
if [ ! -f "${project}/Cargo.toml" ]; then
echo "::error::No Cargo.toml found in ${project}"
exit 1
fi
cd "${project}"
cargo fmt --check
cargo clippy --all-features -- -D warnings
cd - > /dev/null
echo "::endgroup::"
done

- name: Analyze Changes
id: analyze
run: |
Expand Down Expand Up @@ -97,17 +117,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Run sccache-cache
if: github.event_name != 'release'
uses: mozilla-actions/[email protected]
- name: Set Rust cache env vars
if: github.event_name != 'release'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run fmt and clippy
run: |
readarray -t all_projects < <(echo '${{ needs.changes.outputs.changed_projects }}' | jq -r '.[]?')
Expand Down Expand Up @@ -137,23 +146,20 @@ jobs:
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run sccache-cache
if: github.event_name != 'release'
uses: mozilla-actions/[email protected]
- name: Set Rust cache env vars
if: github.event_name != 'release'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: dorny/paths-filter@v3
id: changes
if: github.event_name == 'pull_request'
with:
path: ~/.cargo/bin/steel
key: ${{ runner.os }}-steel-cli
list-files: shell
filters: |
native:
- added|modified: '**/native/**'
workflow:
- added|modified: '.github/workflows/solana-native.yml'
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 'lts/*'
check-latest: true
- name: Setup build environment
id: setup
Expand All @@ -168,8 +174,9 @@ jobs:
echo "Building and Testing $project with Solana $solana_version"
cd "$project" || return 1

# Install dependencies
# Check if this is a pnpm project or Steel CLI project
if [ -f "package.json" ]; then
# Use pnpm for projects with package.json
if ! pnpm install --frozen-lockfile; then
echo "::error::pnpm install failed for $project"
echo "$project: pnpm install failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
Expand All @@ -186,20 +193,14 @@ jobs:
fi

# Test
if ! pnpm build-and-test; then
if ! pnpm test; then
echo "::error::tests failed for $project"
echo "$project: tests failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi
else
# Use Steel CLI
if ! cargo install --quiet steel-cli; then
echo "::error::steel-cli installation failed for $project"
echo "$project: steel-cli installation failed with $solana_version" >> $GITHUB_WORKSPACE/failed_projects.txt
cd - > /dev/null
return 1
fi
# Use Steel CLI for pure Steel projects

# Build
if ! steel build; then
Expand Down Expand Up @@ -252,36 +253,30 @@ jobs:
# Make the script executable
chmod +x build_and_test.sh

- name: Setup Solana stable
uses: heyAyushh/setup-solana@v5.5
- name: Setup Solana Stable
uses: heyAyushh/setup-solana@v2.02
with:
solana-cli-version: stable
- name: Build and Test with Stable
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
run: |
source build_and_test.sh
solana -V
rustc -V
solana-keygen new --no-bip39-passphrase
solana-keygen new --no-bip39-passphrase --force
cargo install --quiet steel-cli
process_projects "stable"
sccache --show-stats
- name: Setup Solana 1.18.17
uses: heyAyushh/[email protected]
- name: Setup Solana Beta
uses: heyAyushh/[email protected]
with:
solana-cli-version: 1.18.17
- name: Build and Test with 1.18.17
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
solana-cli-version: beta
- name: Build and Test with Beta
run: |
source build_and_test.sh
solana -V
rustc -V
solana-keygen new --no-bip39-passphrase --force
process_projects "1.18.17"
sccache --show-stats
cargo install --quiet steel-cli
process_projects "beta"

- name: Set failed projects output
id: set-failed
Expand Down
Loading
Loading