Browse Source

ci: add anchor init template test (#1525)

Paul 3 years ago
parent
commit
9010921a45
1 changed files with 30 additions and 0 deletions
  1. 30 0
      .github/workflows/tests.yaml

+ 30 - 0
.github/workflows/tests.yaml

@@ -234,6 +234,36 @@ 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 && 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
       - 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)" && anchor init hello-anchor && cd hello-anchor && anchor test
+
   test-programs:
   test-programs:
     needs: setup-anchor-cli
     needs: setup-anchor-cli
     name: Test ${{ matrix.node.path }}
     name: Test ${{ matrix.node.path }}