Skip to content

Cache entire .cargo directory as it still seems really slow #12

Cache entire .cargo directory as it still seems really slow

Cache entire .cargo directory as it still seems really slow #12

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 CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Install Solana
run: |
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
- name: Add Solana bin directory to PATH
run: |
echo "~/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
- name: Install Rust
# https://stackoverflow.com/questions/57251508/run-rustups-curl-fetched-installer-script-non-interactively
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
# "On a cache miss, the action automatically creates a new cache if the job completes successfully."
# From Rust example at https://github.com/actions/cache/tree/main
- name: Restore Rust dependencies from Cache if possible
uses: actions/cache@v3
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Anchor
run: |
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
avm install latest
avm use latest
- name: Add Anchor bin directory to PATH
run: |
echo "~/.avm/bin" >> $GITHUB_PATH
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# TODO: clean up debug logs below
- name: Check 'Favorites' program compiles and passes tests
run: |
cd labs/favorites
cd programs/favorites
echo $PATH
ls -la ~/.local/share/solana/install/active_release/bin
ls -la ~/.avm/bin
anchor test