ci: add CI script for pop-api
tests and integration tests
#1
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 | ||
strategy: | ||
matrix: | ||
platform: | ||
- macos-latest | ||
- windows-latest | ||
toolchain: | ||
- stable | ||
job: | ||
- contract build | ||
- test | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: "./.github/actions/init" | ||
- name: Download and run latest `substrate-contracts-node` binary | ||
if: matrix.os == 'macOS-latest' | ||
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 and run latest `substrate-contracts-node` binary | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --force --locked && \ | ||
substrate-contracts-node -lruntime::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: ${{ matrix.job }} integration-tests on ${{ matrix.platform }}-${{ matrix.toolchain }} | ||
working-directory: ${{env.CONTRACT_INTEGRATION_TESTS}} | ||
run: | | ||
for contract in ${SUBCONTRACT_DIRECTORIES}; do | ||
echo "Processing contract: $contract"; | ||
cargo ${{ matrix.job }} --release --manifest-path contracts/${contract}/Cargo.toml; | ||
done |