Skip to content

Commit

Permalink
Check hashes of deployed programs in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dankelleher committed Jan 26, 2024
1 parent 919cd0b commit 191c685
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
cargo-build:
needs: install
runs-on: ubuntu-latest
outputs:
target_deploy_artifact: ${{ steps.build-artifact-upload-step.outputs.artifact-id }}
steps:
- uses: actions/checkout@v4
- name: Cache rust
Expand All @@ -66,8 +68,13 @@ jobs:
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }}
- name: Build all programs
run: cargo build-sbf
- name: Calculate build hash
run: |
ls -l target/deploy
echo ${{ hashFiles('target/deploy') }} > target/deploy/hash.txt
- name: Upload build artifacts
uses: actions/upload-artifact@v3
id: build-artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: target_deploy
path: target/deploy
Expand Down Expand Up @@ -115,7 +122,7 @@ jobs:
run: yarn build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dists
path: packages/sdks/*/dist
Expand All @@ -139,7 +146,7 @@ jobs:
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

- name: Download build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dists
path: packages/sdks
Expand Down Expand Up @@ -171,19 +178,19 @@ jobs:
run: yarn --frozen-lockfile

- name: Download JS build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dists
path: packages/sdks

- name: Download Rust build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: target_deploy
path: ./target
path: ./target/deploy

- name: Download TS build artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: dists
path: packages/sdks
Expand All @@ -197,17 +204,20 @@ jobs:
target
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }}
- name: run tests
run: yarn test
run: |
ls -l target/deploy
cat target/deploy/hash.txt
yarn test
- name: upload program logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: program-logs
path: .anchor/program-logs/*

- name: upload test report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: test-report
Expand Down

0 comments on commit 191c685

Please sign in to comment.