Fix bare installation issues #398
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: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
solana_version: 1.18.1 | |
anchor_version: 0.29.0 | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [ | |
"test_basic_0", | |
"test_basic_1", | |
"test_basic_2", | |
"test_basic_3", | |
"test_basic_3_bankrun", | |
"test_chat", | |
"test_cli", | |
"test_cli_init", | |
"test_composite", | |
"test_errors", | |
"test_events", | |
"test_misc", | |
"test_misc_core", | |
"test_misc_core_bankrun", | |
"test_multisig", | |
"test_zero_copy", | |
"client_gen/test_client_gen", | |
"client_gen/test_functional", | |
] | |
steps: | |
- name: Checkout repo. | |
uses: actions/checkout@v2 | |
with: | |
submodules: "recursive" | |
- name: Cache Solana Tool Suite | |
uses: actions/cache@v2 | |
id: cache-solana | |
with: | |
path: | | |
~/.cache/solana/ | |
~/.local/share/solana/ | |
key: solana-${{ runner.os }}-v0000-${{ env.solana_version }} | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.75.0 | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- name: Install Solana | |
if: steps.cache-solana.outputs.cache-hit != 'true' | |
run: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.solana_version }}/install)" | |
- name: Add Solana to path | |
run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH | |
- name: Setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Anchor CLI | |
run: npm install -g @coral-xyz/anchor-cli@${{ env.anchor_version }} | |
- name: Check CLI Anchor installation | |
run: anchor -V | |
- name: Generate local keypair | |
run: solana-keygen new --no-bip39-passphrase | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.9 | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.3.2 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install dependencies | |
run: poetry install -E cli --no-interaction --no-root | |
#---------------------------------------------- | |
# install your root project | |
#---------------------------------------------- | |
- name: Install library | |
run: poetry install -E cli --no-interaction | |
#---------------------------------------------- | |
# run test suite | |
#---------------------------------------------- | |
- name: Run tests | |
run: poetry run pytest tests/${{ matrix.node }}.py | |
all_good: | |
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: note that all tests succeeded | |
run: echo "🎉" |