Skip to content

More minor slide tweaks #116

More minor slide tweaks

More minor slide tweaks #116

Workflow file for this run

# From https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs#using-the-nodejs-starter-workflow
name: Node.js and Solana CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
project: [favorites, escrow]
steps:
- uses: actions/checkout@v4
# See https://github.com/metaDAOproject/setup-anchor for docs
- uses: metadaoproject/[email protected]
with:
anchor-version: "latest"
# Install Solana CLI (beta, required to fix 'ahash' issue)
solana-cli-version: "1.18.5"
node-version: "20.12.2"
# git will keep outputting:
# hint: Using 'master' as the name for the initial branch. This default branch name
# hint: is subject to change.
# Unless we set this.
- name: Set a default branch name for git
run: |
git config --global init.defaultBranch main
- name: Print versions and debugging info
run: |
echo Linux version:
lsb_release -a
echo Solana version:
solana -V
echo Anchor version:
anchor -V
echo build-sbf version:
cargo build-sbf --version
echo Path:
echo $PATH | tr ':' '\n' | sort
# Fixes:
# Error: Unable to read keypair file
# during 'anchor test'
- name: Make a default keypair
run: |
solana-keygen new --no-bip39-passphrase
# Fix:
# warning: tool `rust-analyzer` is already installed, remove it from `/home/runner/.cargo/bin`, then run `rustup update` to have rustup manage this tool.
# warning: tool `rustfmt` is already installed, remove it from `/home/runner/.cargo/bin`, then run `rustup update` to have rustup manage this tool.
# warning: tool `cargo-fmt` is already installed, remove it from `/home/runner/.cargo/bin`, then run `rustup update` to have rustup manage this tool.
- name: Fix already installed tools
run: |
rm /home/runner/.cargo/bin/rust-analyzer /home/runner/.cargo/bin/rustfmt /home/runner/.cargo/bin/cargo-fmt
rustup update
# TODO: remove fix for semver issue once
# https://github.com/solana-labs/solana/issues/32503 is resolved
- name: Test the ${{ matrix.project }} project builds and tests pass
run: |
cd labs/${{ matrix.project }}
echo "----------------------------------------"
echo "Fixing solana-program crate not using semver issue..."
sed -i 's/ctx/_context/' programs/${{ matrix.project }}/src/lib.rs
cargo add solana-program@"=1.18.5"
echo "----------------------------------------"
echo "Creating a keypair..."
solana-keygen new --no-bip39-passphrase -s -o deleteme.json
echo SECRET_KEY="$(cat deleteme.json)"> .env
cat .env
echo "----------------------------------------"
echo "Installing packages..."
npm i
echo "----------------------------------------"
echo "Running 'anchor test'..."
anchor test 2>&1 | tee -a build.log
echo "----------------------------------------"
echo "build.log..."
cat build.log
echo "----------------------------------------"
echo "Checking for errors or warnings in build.log..."
grep -qiEvz 'error:|warning:|failed' build.log
echo $?