ci: add CI script for pop-api
tests and integration tests
#3
Workflow file for this run
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: contract | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
integration-tests: | |
env: | |
SUBCONTRACT_DIRECTORIES: "create_token_in_constructor fungibles" | |
CONTRACT_INTEGRATION_TESTS: pop-api/integration-tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: "./.github/actions/init" | |
- name: Download and run latest `substrate-contracts-node` binary | |
run: | | |
curl -L -o substrate-contracts-node.zip 'https://gitlab.parity.io/parity/mirrors/substrate-contracts-node/-/jobs/artifacts/main/download?job=build-mac' && \ | |
unzip substrate-contracts-node.zip && \ | |
chmod +x artifacts/substrate-contracts-node-mac/substrate-contracts-node && | |
./artifacts/substrate-contracts-node-mac/substrate-contracts-node -linfo,runtime::contracts=debug 2>&1 | tee /tmp/contracts-node.log & | |
- name: Install `cargo-contract` `master` | |
uses: baptiste0928/cargo-install@9f6037ed331dcf7da101461a20656273fa72abf0 # v3.1.0 | |
with: | |
crate: cargo-contract | |
git: https://github.com/use-ink/cargo-contract.git | |
branch: master | |
- name: Output versions | |
run: | | |
cargo -vV | |
cargo contract --version | |
- name: Build contracts | |
working-directory: ${{env.CONTRACT_INTEGRATION_TESTS}} | |
run: | | |
for contract in ${SUBCONTRACT_DIRECTORIES}; do | |
echo "Processing contract: $contract"; | |
cargo contract build --release --manifest-path contracts/${contract}/Cargo.toml; | |
done | |
- name: Run integration tests | |
working-directory: ${{env.CONTRACT_INTEGRATION_TESTS}} | |
run: cargo test |