From be3480c0a776b7fd117be4749fc36e28382d8d1b Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sat, 26 Feb 2022 23:16:59 +0100 Subject: [PATCH 1/3] ci: add anchor init template test --- .github/workflows/tests.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index adf82ad085..616592a9f5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -234,6 +234,37 @@ jobs: - run: cd tests/bpf-upgradeable-state && solana program deploy --program-id program_with_different_programdata.json target/deploy/bpf_upgradeable_state.so - run: cd tests/bpf-upgradeable-state && cp bpf_upgradeable_state-keypair.json target/deploy/bpf_upgradeable_state-keypair.json && anchor deploy && anchor test --skip-deploy --skip-build --skip-lint + 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/ + - run: cd "$(mktemp -d)" + - run: anchor init hello-anchor && cd hello-anchor + - run: anchor test + test-programs: needs: setup-anchor-cli name: Test ${{ matrix.node.path }} From ddf6cad3288254fb392feadf28d2f3935e76445a Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sat, 26 Feb 2022 23:31:28 +0100 Subject: [PATCH 2/3] ci: fix ci --- .github/workflows/tests.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 616592a9f5..d686b7c54e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -262,7 +262,9 @@ jobs: name: anchor-binary path: ~/.cargo/bin/ - run: cd "$(mktemp -d)" - - run: anchor init hello-anchor && cd hello-anchor + - run: anchor init hello-anchor + - run: cd hello-anchor + - run: pwd - run: anchor test test-programs: From 7b389fef471b7150e6366d96d9713aa5847fffb6 Mon Sep 17 00:00:00 2001 From: Paul Schaaf Date: Sat, 26 Feb 2022 23:45:12 +0100 Subject: [PATCH 3/3] ci: fix ci --- .github/workflows/tests.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d686b7c54e..1a1ca3ff81 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -261,11 +261,8 @@ jobs: with: name: anchor-binary path: ~/.cargo/bin/ - - run: cd "$(mktemp -d)" - - run: anchor init hello-anchor - - run: cd hello-anchor - - run: pwd - - run: anchor test + + - run: cd "$(mktemp -d)" && anchor init hello-anchor && cd hello-anchor && anchor test test-programs: needs: setup-anchor-cli