Skip to content

Commit

Permalink
test: improve CI build time
Browse files Browse the repository at this point in the history
  • Loading branch information
aalu1418 committed Sep 25, 2024
1 parent 888970a commit 4d96347
Showing 1 changed file with 7 additions and 26 deletions.
33 changes: 7 additions & 26 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,11 @@ jobs:
needs: [get_projectserum_version]
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Cache cargo registry
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo index
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
path: ~/.cargo
key: ${{ runner.os }}-v2-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo target dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
Expand All @@ -50,10 +44,11 @@ jobs:
env:
psversion: ${{ needs.get_projectserum_version.outputs.projectserum_version }}
run: |
docker run -v "$(pwd)/../":/repo backpackapp/build:"${psversion}" bash -c "\
docker run -v ~/.cargo:/.cargo -v "$(pwd)/../":/repo backpackapp/build:"${psversion}" bash -c "\
set -eoux pipefail &&\
RUSTUP_HOME=\"/root/.rustup\" &&\
FORCE_COLOR=1 &&\
cp -rn /.cargo/. /root/.cargo &&\
cd /repo/contracts &&\
solana-keygen new -o id.json --no-bip39-passphrase &&\
cd /repo/ts &&\
Expand All @@ -64,23 +59,9 @@ jobs:
anchor test &&\
cd /repo/contracts/examples/hello-world &&\
yarn install --frozen-lockfile &&\
anchor test"
# - run: solana-keygen new -o id.json --no-bip39-passphrase
# - name: Compile typescript client
# run: |
# cd ../ts
# yarn install --frozen-lockfile
# yarn build
# - name: anchor test contracts
# run: |
# yarn install --frozen-lockfile
# anchor test
# - name: anchor test hello-world
# run: |
# cd examples/hello-world
# yarn install --frozen-lockfile
# anchor test
anchor test &&\
chmod -R 755 /repo/contracts/target &&\
rm -rf /.cargo/* && cp -r /root/.cargo/. /.cargo"
rust_lint:
name: Rust Lint
Expand Down

0 comments on commit 4d96347

Please sign in to comment.