Check hashes of deployed programs in CI #106
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
pull_request: | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/cache-solana | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache node dependencies | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: install node_modules | |
run: yarn --frozen-lockfile --network-concurrency 2 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
- name: install essentials | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pkg-config build-essential libudev-dev | |
clippy-lint: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Run fmt | |
run: cargo fmt -- --check | |
- name: Run clippy | |
run: cargo clippy -- --deny=warnings | |
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 | |
uses: Swatinem/rust-cache@v2 | |
- uses: ./.github/actions/cache-solana | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }} | |
- name: Build all programs | |
run: cargo build-sbf | |
- name: Upload build artifacts | |
id: build-artifact-upload-step | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target_deploy | |
path: target/deploy | |
if-no-files-found: error | |
retention-days: 1 | |
cargo-test: | |
needs: cargo-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache rust | |
uses: Swatinem/rust-cache@v2 | |
- uses: ./.github/actions/cache-solana | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }} | |
- name: Run tests | |
run: | | |
cargo test-sbf | |
yarn-build: | |
needs: install | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache node dependencies | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Run build | |
run: yarn build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dists | |
path: packages/sdks/*/dist | |
if-no-files-found: error | |
retention-days: 1 | |
yarn-lint: | |
needs: yarn-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Cache node dependencies | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dists | |
path: packages/sdks | |
- name: Run lint | |
run: | | |
test -d packages/sdks/common/dist | |
yarn lint | |
functional-test: | |
needs: [yarn-build, cargo-build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- uses: ./.github/actions/cache-solana | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('rust-toolchain.toml') }} | |
- name: Cache node dependencies | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: install node_modules | |
run: yarn --frozen-lockfile | |
- name: Download JS build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dists | |
path: packages/sdks | |
- name: Download Rust build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target_deploy | |
path: ./target/deploy | |
- name: run tests | |
run: yarn test | |
- name: upload program logs | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: program-logs | |
path: .anchor/program-logs/* | |
- name: upload test report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-report | |
path: mochawesome-report/* |