update wallet #12
This file contains hidden or 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: Anchor Tests | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| - name: Install npm dependencies | |
| run: pnpm install | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install Solana | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash | |
| echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
| - name: Restore wallet | |
| run: | | |
| echo "${{ secrets.ANCHOR_WALLET }}" | base64 --decode > /home/runner/.config/solana/id.json | |
| echo "ANCHOR_WALLET=/home/runner/.config/solana/id.json" >> $GITHUB_ENV | |
| # - name: Generate wallet | |
| # run: | | |
| # solana-keygen new --no-bip39-passphrase --outfile /home/runner/.config/solana/id.json | |
| # echo "ANCHOR_WALLET=/home/runner/.config/solana/id.json" >> $GITHUB_ENV | |
| - name: Start validator | |
| run: solana-test-validator --reset & | |
| - name: Airdrop SOL | |
| run: | | |
| solana config set -u localhost | |
| solana config set --keypair /home/runner/.config/solana/id.json | |
| solana airdrop 10 $(solana-keygen pubkey /home/runner/.config/solana/id.json) | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run Build | |
| run: anchor build | |
| # - name: Run tests | |
| # run: anchor test --skip-local-validator |