From 569bbfa457c4c90c8f547b383db094fd09ccb16e Mon Sep 17 00:00:00 2001 From: Joe Caulfield Date: Sun, 23 Jun 2024 15:08:57 -0500 Subject: [PATCH] CI patch --- .github/workflows/main.yml | 36 ++++++++++++++++++++---------------- .gitignore | 4 ---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 397c2a8..d9277ef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,10 +16,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: ~/.rustup/toolchains/${{ env.NIGHTLY_TOOLCHAIN }} - key: ${{ runner.os }}-rust-toolchain-${{ env.NIGHTLY_TOOLCHAIN }} - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} @@ -34,14 +30,18 @@ jobs: - uses: actions/checkout@v4 - uses: actions/cache@v4 with: - path: ~/.rustup/toolchains/${{ env.NIGHTLY_TOOLCHAIN }} - key: ${{ runner.os }}-rust-toolchain-${{ env.NIGHTLY_TOOLCHAIN }} + path: | + ~/.cargo/registry + ~/.cargo/git + key: cargo-clippy-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + cargo-clippy- - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} components: clippy - name: Run clippy - run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} clippy --all -- --deny=warnings + run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} clippy --all --tests -- --deny=warnings cargo_build_test: name: Cargo Build and Test @@ -49,21 +49,25 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/cache@v4 + id: cache-solana-toolchain with: - path: ~/.local/share/solana/install/active_release/bin/solana - key: ${{ runner.os }}-solana-${{ env.SOLANA_VERSION }} + path: | + ~/.local/share/solana/install/releases/${{ env.SOLANA_VERSION }} + ~/.cache/solana + key: solana-toolchain-${{ env.SOLANA_VERSION }} + restore-keys: | + solana-toolchain- - uses: actions/cache@v4 with: + with: path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry + ~/.cargo/git + key: cargo-build-sbf-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo- + cargo-build-sbf- - uses: metaplex-foundation/actions/install-solana@v1 + if: steps.cache-solana-toolchain.outputs.cache-hit != 'true' with: version: ${{ env.SOLANA_VERSION }} - name: Build test program diff --git a/.gitignore b/.gitignore index 6985cf1..73fab07 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,6 @@ debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - # These are backup files generated by rustfmt **/*.rs.bk