2021-11-27 08:57:43 -08:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-11-30 12:44:15 -08:00
|
|
|
env:
|
2022-12-10 02:18:18 -08:00
|
|
|
SOLANA_CLI_VERSION: 1.14.9
|
2021-11-27 08:57:43 -08:00
|
|
|
NODE_VERSION: 17.0.1
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-core:
|
|
|
|
name: Core Tests
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-11-27 08:57:43 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache Cargo registry + index
|
|
|
|
id: cache-cargo-build
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
./target/
|
|
|
|
key: cargo-${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- run: cargo build
|
|
|
|
- run: cargo fmt -- --check
|
|
|
|
- run: cargo clippy --all-targets -- -D warnings
|
|
|
|
- run: cargo test
|
2022-04-11 08:14:47 -07:00
|
|
|
# using singlethreaded testing for avm so that tests that change files do not conflict with each other
|
2022-04-11 06:14:06 -07:00
|
|
|
- run: cd avm && cargo fmt -- --check && cargo clippy --all-targets -- -D warnings && cargo test -- --test-threads=1
|
2022-03-20 12:42:50 -07:00
|
|
|
- run: cd ts && yarn --frozen-lockfile
|
2021-11-30 12:44:15 -08:00
|
|
|
- run: cd ts && yarn test
|
|
|
|
- run: cd ts && yarn lint
|
2022-03-20 12:42:50 -07:00
|
|
|
- run: cd examples/tutorial && yarn --frozen-lockfile
|
2021-12-15 15:11:41 -08:00
|
|
|
- run: cd examples/tutorial && yarn lint
|
2022-03-20 12:42:50 -07:00
|
|
|
- run: cd tests && yarn --frozen-lockfile
|
2021-12-15 15:11:41 -08:00
|
|
|
- run: cd tests && yarn lint
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
2021-11-27 08:57:43 -08:00
|
|
|
|
|
|
|
setup-anchor-cli:
|
|
|
|
name: Setup Anchor cli
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-11-27 08:57:43 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache Cargo registry + index
|
|
|
|
id: cache-anchor
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
./target/
|
|
|
|
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- run: cargo install --path cli anchor-cli --locked --force
|
2022-04-12 13:55:00 -07:00
|
|
|
- run: chmod +x ~/.cargo/bin/anchor
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/anchor
|
|
|
|
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
test-examples:
|
|
|
|
needs: setup-anchor-cli
|
|
|
|
name: Examples Test
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-11-27 08:57:43 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
|
|
|
- run: chmod +rwx ~/.cargo/bin/anchor
|
2022-04-12 13:55:00 -07:00
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-solana/
|
|
|
|
- uses: ./.github/actions/setup-ts/
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: basic-0 cache
|
|
|
|
id: cache-basic-0
|
|
|
|
with:
|
|
|
|
path: ./examples/tutorial/basic-0/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('./examples/tutorial/basic-0/**/Cargo.toml') }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: basic-1 cache
|
|
|
|
id: cache-basic-1
|
|
|
|
with:
|
|
|
|
path: ./examples/tutorial/basic-1/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('./examples/tutorial/basic-1/**/Cargo.toml') }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: basic-2 cache
|
|
|
|
id: cache-basic-2
|
|
|
|
with:
|
|
|
|
path: ./examples/tutorial/basic-2/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('./examples/tutorial/basic-2/**/Cargo.toml') }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: basic-3 cache
|
|
|
|
id: cache-basic-3
|
|
|
|
with:
|
|
|
|
path: ./examples/tutorial/basic-3/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('./examples/tutorial/basic-3/**/Cargo.toml') }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: basic-4 cache
|
|
|
|
id: cache-basic-4
|
|
|
|
with:
|
|
|
|
path: ./examples/tutorial/basic-4/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-${{ hashFiles('./examples/tutorial/basic-4/**/Cargo.toml') }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-27 08:57:43 -08:00
|
|
|
- run: cd examples/tutorial && yarn workspaces run test
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
2021-11-27 08:57:43 -08:00
|
|
|
|
|
|
|
setup-client-example:
|
|
|
|
needs: setup-anchor-cli
|
|
|
|
name: Setup Client Example Test
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-11-27 08:57:43 -08:00
|
|
|
strategy:
|
2022-02-20 14:28:24 -08:00
|
|
|
fail-fast: false
|
2021-11-27 08:57:43 -08:00
|
|
|
matrix:
|
|
|
|
node:
|
|
|
|
- path: tests/events/
|
|
|
|
name: events.so
|
|
|
|
- path: examples/tutorial/basic-4/
|
|
|
|
name: basic_4.so
|
|
|
|
- path: examples/tutorial/basic-2/
|
|
|
|
name: basic_2.so
|
|
|
|
- path: tests/composite/
|
|
|
|
name: composite.so
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-solana/
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
|
|
|
- run: chmod +rwx ~/.cargo/bin/anchor
|
2022-04-12 13:55:00 -07:00
|
|
|
|
2022-02-20 16:43:19 -08:00
|
|
|
- run: cd ${{ matrix.node.path }} && anchor build --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.node.name }}
|
|
|
|
path: ${{ matrix.node.path }}target/deploy/${{ matrix.node.name }}
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
2021-11-30 12:44:15 -08:00
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
test-client-example:
|
|
|
|
needs: setup-client-example
|
|
|
|
name: Client Example Test
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-11-27 08:57:43 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-ts/
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
2022-04-12 13:55:00 -07:00
|
|
|
- run: chmod +x ~/.cargo/bin/anchor
|
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: events.so
|
|
|
|
path: tests/events/target/deploy/
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: basic_4.so
|
|
|
|
path: examples/tutorial/basic-4/target/deploy/
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: basic_2.so
|
|
|
|
path: examples/tutorial/basic-2/target/deploy/
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: composite.so
|
|
|
|
path: tests/composite/target/deploy/
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache client/example target
|
|
|
|
id: cache-test-target
|
|
|
|
with:
|
|
|
|
path: client/example/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-client/example-${{ env.ANCHOR_VERSION }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: ./.github/actions/setup-solana/
|
2021-11-30 12:44:15 -08:00
|
|
|
- run: cd client/example && ./run-test.sh
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
2021-11-27 08:57:43 -08:00
|
|
|
|
2021-12-05 11:14:16 -08:00
|
|
|
test-bpf-upgradeable-state:
|
|
|
|
needs: setup-anchor-cli
|
|
|
|
name: Test tests/bpf-upgradeable-state
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-12-05 11:14:16 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-ts/
|
|
|
|
- uses: ./.github/actions/setup-solana/
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache Cargo registry + index
|
|
|
|
id: cache-anchor
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
./target/
|
|
|
|
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
2022-04-12 13:55:00 -07:00
|
|
|
- run: chmod +x ~/.cargo/bin/anchor
|
2021-12-05 11:14:16 -08:00
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache tests/bpf-upgradeable-state target
|
|
|
|
id: cache-test-target
|
|
|
|
with:
|
|
|
|
path: tests/bpf-upgradeable-state/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-tests/bpf-upgradeable-state-${{ env.ANCHOR_VERSION }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-12-05 11:14:16 -08:00
|
|
|
|
|
|
|
- run: solana-test-validator -r --quiet &
|
|
|
|
name: start validator
|
2022-03-20 12:42:50 -07:00
|
|
|
- run: cd tests/bpf-upgradeable-state && yarn --frozen-lockfile
|
2022-04-12 15:16:04 -07:00
|
|
|
- run: cd tests/bpf-upgradeable-state
|
2022-02-20 16:43:19 -08:00
|
|
|
- run: cd tests/bpf-upgradeable-state && anchor build --skip-lint
|
2021-12-05 11:14:16 -08:00
|
|
|
- run: cd tests/bpf-upgradeable-state && solana program deploy --program-id program_with_different_programdata.json target/deploy/bpf_upgradeable_state.so
|
2022-03-24 16:16:25 -07:00
|
|
|
- run: cd tests/bpf-upgradeable-state && cp bpf_upgradeable_state-keypair.json target/deploy/bpf_upgradeable_state-keypair.json && anchor test --skip-local-validator --skip-build --skip-lint
|
2022-04-17 12:54:28 -07:00
|
|
|
- run: cd tests/bpf-upgradeable-state && npx tsc --noEmit
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
2021-12-05 11:14:16 -08:00
|
|
|
|
2022-03-26 17:28:55 -07:00
|
|
|
# this test exists to make sure that anchor
|
|
|
|
# checks rent correctly for legacy accounts
|
|
|
|
# that don't have to be rent-exempt
|
|
|
|
test-misc-non-rent-exempt:
|
|
|
|
# the anchor cli is built with a different solana version
|
|
|
|
# but that's fine since it's just the cli
|
2022-04-20 14:38:45 -07:00
|
|
|
needs: setup-anchor-cli
|
2022-03-26 17:28:55 -07:00
|
|
|
name: Test tests/misc/nonRentExempt
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-ts/
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache Solana Tool Suite
|
|
|
|
id: cache-solana
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/solana/
|
|
|
|
~/.local/share/solana/
|
|
|
|
key: solana-${{ runner.os }}-v0000-1.8.14
|
|
|
|
# using an outdated validator but that
|
|
|
|
# is ok as long as the test doesn't
|
|
|
|
# include newer incompatible features
|
|
|
|
- run: sh -c "$(curl -sSfL https://release.solana.com/v1.8.14/install)"
|
|
|
|
shell: bash
|
|
|
|
- run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
|
|
|
|
shell: bash
|
|
|
|
- run: solana-keygen new --no-bip39-passphrase
|
|
|
|
shell: bash
|
|
|
|
- run: solana config set --url localhost
|
|
|
|
shell: bash
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
|
|
|
- run: chmod +x ~/.cargo/bin/anchor
|
2022-04-12 13:55:00 -07:00
|
|
|
|
2022-03-26 17:28:55 -07:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache tests/misc target
|
|
|
|
id: cache-test-target
|
|
|
|
with:
|
|
|
|
path: tests/misc/target
|
|
|
|
key: cargo-${{ runner.os }}-tests/misc-${{ env.ANCHOR_VERSION }}-1.8.14-${{ hashFiles('**/Cargo.lock') }}
|
2022-04-20 14:38:45 -07:00
|
|
|
|
2022-03-26 17:28:55 -07:00
|
|
|
- run: cd tests/misc && yarn --frozen-lockfile
|
2022-04-12 15:16:04 -07:00
|
|
|
- run: cd tests/misc
|
2022-03-26 17:28:55 -07:00
|
|
|
- run: cd tests/misc && chmod +x ci.sh && ./ci.sh
|
|
|
|
- run: cd tests/misc && anchor test --skip-lint
|
|
|
|
|
2022-02-26 15:42:57 -08:00
|
|
|
test-anchor-init:
|
|
|
|
needs: setup-anchor-cli
|
|
|
|
name: Test Anchor Init
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-ts/
|
|
|
|
- uses: ./.github/actions/setup-solana/
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache Cargo registry + index
|
|
|
|
id: cache-anchor
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
./target/
|
|
|
|
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
2022-04-12 13:55:00 -07:00
|
|
|
- run: chmod +x ~/.cargo/bin/anchor
|
2022-02-26 15:42:57 -08:00
|
|
|
|
2022-04-12 16:29:52 -07:00
|
|
|
- run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && yarn link @project-serum/anchor && yarn && anchor test && yarn lint:fix
|
2022-03-20 12:42:50 -07:00
|
|
|
- uses: ./.github/actions/git-diff/
|
2022-02-26 15:42:57 -08:00
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
test-programs:
|
|
|
|
needs: setup-anchor-cli
|
|
|
|
name: Test ${{ matrix.node.path }}
|
|
|
|
runs-on: ubuntu-18.04
|
2022-02-21 07:49:51 -08:00
|
|
|
timeout-minutes: 30
|
2021-11-27 08:57:43 -08:00
|
|
|
strategy:
|
2022-02-20 14:28:24 -08:00
|
|
|
fail-fast: false
|
2021-11-27 08:57:43 -08:00
|
|
|
matrix:
|
|
|
|
node:
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/sysvars && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/sysvars
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/composite && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/composite
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/errors && anchor test --skip-lint && npx tsc --noEmit
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/errors
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/spl/token-proxy && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: spl/token-proxy
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/multisig && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/multisig
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/interface && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/interface
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/lockup && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/lockup
|
2022-03-20 12:42:50 -07:00
|
|
|
- cmd: cd tests/swap/deps/serum-dex/dex && cargo build-bpf -- --locked && cd ../../../ && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/swap
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/escrow && anchor test --skip-lint && npx tsc --noEmit
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/escrow
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/pyth && anchor test --skip-lint && npx tsc --noEmit
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/pyth
|
2022-07-05 12:54:40 -07:00
|
|
|
- cmd: cd tests/realloc && anchor test --skip-lint && npx tsc --noEmit
|
|
|
|
path: tests/realloc
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/system-accounts && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/system-accounts
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/misc && anchor test --skip-lint && npx tsc --noEmit
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/misc
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/events && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/events
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/cashiers-check && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/cashiers-check
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/declare-id && anchor test --skip-lint && npx tsc --noEmit
|
2022-02-15 15:16:06 -08:00
|
|
|
path: tests/declare-id
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/typescript && anchor test --skip-lint && npx tsc --noEmit
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/typescript
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/zero-copy && anchor test --skip-lint && cd programs/zero-copy && cargo test-bpf
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/zero-copy
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/chat && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/chat
|
2022-02-20 16:43:19 -08:00
|
|
|
- cmd: cd tests/ido-pool && anchor test --skip-lint
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/ido-pool
|
2022-03-20 12:42:50 -07:00
|
|
|
- cmd: cd tests/cfo && anchor run test-with-build && cd deps/stake && git checkout Cargo.lock && cd ../swap && git checkout Cargo.lock
|
2021-11-27 08:57:43 -08:00
|
|
|
path: tests/cfo
|
2022-03-20 12:42:50 -07:00
|
|
|
- cmd: cd tests/auction-house && yarn --frozen-lockfile && anchor test --skip-lint && git checkout Cargo.lock
|
2022-01-24 11:44:24 -08:00
|
|
|
path: tests/auction-house
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/floats && yarn --frozen-lockfile && anchor test --skip-lint && npx tsc --noEmit
|
2022-02-17 11:23:21 -08:00
|
|
|
path: tests/floats
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/safety-checks && anchor run test
|
2022-02-17 14:45:33 -08:00
|
|
|
path: tests/safety-checks
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/custom-coder && anchor test --skip-lint && npx tsc --noEmit
|
2022-03-16 15:27:57 -07:00
|
|
|
path: tests/custom-coder
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/validator-clone && anchor test --skip-lint && npx tsc --noEmit
|
2022-03-12 14:36:35 -08:00
|
|
|
path: tests/validator-clone
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/cpi-returns && anchor test --skip-lint && npx tsc --noEmit
|
2022-03-24 11:40:38 -07:00
|
|
|
path: tests/cpi-returns
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/multiple-suites && anchor test --skip-lint && npx tsc --noEmit
|
2022-03-30 14:17:54 -07:00
|
|
|
path: tests/multiple-suites
|
2022-04-17 12:54:28 -07:00
|
|
|
- cmd: cd tests/pda-derivation && anchor test --skip-lint && npx tsc --noEmit
|
|
|
|
path: tests/pda-derivation
|
2022-04-20 14:38:45 -07:00
|
|
|
- cmd: cd tests/anchor-cli-idl && ./test.sh
|
|
|
|
path: tests/anchor-cli-idl
|
2021-11-27 08:57:43 -08:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: ./.github/actions/setup/
|
|
|
|
- uses: ./.github/actions/setup-ts/
|
|
|
|
- uses: ./.github/actions/setup-solana/
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache Cargo registry + index
|
|
|
|
id: cache-anchor
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
./target/
|
|
|
|
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: anchor-binary
|
|
|
|
path: ~/.cargo/bin/
|
2022-04-12 13:55:00 -07:00
|
|
|
- run: chmod +x ~/.cargo/bin/anchor
|
2022-04-20 14:38:45 -07:00
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
name: Cache ${{ matrix.node.path }} target
|
|
|
|
id: cache-test-target
|
|
|
|
with:
|
|
|
|
path: ${{ matrix.node.path }}/target
|
2022-03-16 12:55:15 -07:00
|
|
|
key: cargo-${{ runner.os }}-${{ matrix.node.path }}-${{ env.ANCHOR_VERSION }}-${{ env.SOLANA_CLI_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
|
2021-11-30 12:44:15 -08:00
|
|
|
|
2021-11-27 08:57:43 -08:00
|
|
|
- run: ${{ matrix.node.cmd }}
|
|
|
|
name: ${{ matrix.node.path }} program test
|
2022-03-20 12:42:50 -07:00
|
|
|
|
|
|
|
- uses: ./.github/actions/git-diff/
|