Pin unsafe GHA to commit SHA #644
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: continuous-intergration/examples | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
paths-ignore: | |
- 'README.md' | |
pull_request: | |
branches: | |
- master | |
paths: | |
- '.github/workflows/examples.yml' | |
jobs: | |
check: | |
name: examples | |
strategy: | |
matrix: | |
platform: | |
- macos-latest | |
- windows-latest | |
toolchain: | |
- stable | |
job: | |
- contract build | |
- test | |
runs-on: ${{ matrix.platform }} | |
env: | |
UPGRADEABLE_CONTRACTS: "forward-calls set-code-hash" | |
DELEGATOR_SUBCONTRACTS: "accumulator adder subber" | |
RUST_BACKTRACE: full | |
steps: | |
- name: Checkout sources & submodules | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Install toolchain | |
id: toolchain | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # Master branch, Rust up to 1.74.1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: rust-src | |
- name: Install cargo-dylint | |
uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # v3.0.0 | |
with: | |
crate: cargo-dylint | |
version: 1 | |
- name: Install dylint-link | |
uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # v3.0.0 | |
with: | |
crate: dylint-link | |
version: 1 | |
- 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: Rust Cache | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
- name: Install `cargo-contract` `master` | |
uses: baptiste0928/cargo-install@1cd874a5478fdca35d868ccc74640c5aabbb8f1b # v3.0.0 | |
with: | |
crate: cargo-contract | |
git: https://github.com/paritytech/cargo-contract.git | |
branch: master | |
- name: Output versions | |
run: | | |
cargo -vV | |
cargo contract --version | |
- name: ${{ matrix.job }} examples on ${{ matrix.platform }}-${{ matrix.toolchain }} | |
if: matrix.os == 'windows-latest' | |
run: | | |
$delegator_subcontracts = "accumulator","adder","subber" | |
foreach ($contract in $delegator_subcontracts) { | |
echo "Processing delegator contract: $contract"; | |
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/delegator/${contract}/Cargo.toml; | |
} | |
$upgradeable_contracts = "forward-calls","set-code-hash" | |
foreach ($contract in $upgradeable_contracts) { | |
echo "Processing upgradeable contract: $contract"; | |
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/upgradeable-contracts/${contract}/Cargo.toml; | |
} | |
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; | |
foreach ($example in Get-ChildItem -Directory "integration-tests\*") { | |
if ($example -Match 'upgradeable-contracts') { continue } | |
if ($example -Match 'lang-err-integration-tests') { continue } | |
echo "Processing example: $example"; | |
cargo ${{ matrix.job }} --verbose --manifest-path=$example/Cargo.toml; | |
cargo clean --manifest-path=$example/Cargo.toml; | |
} | |
- name: ${{ matrix.job }} integration-tests on ${{ matrix.platform }}-${{ matrix.toolchain }} | |
if: matrix.os == 'macOS-latest' | |
run: | | |
for contract in ${DELEGATOR_SUBCONTRACTS}; do | |
echo "Processing delegator contract: $contract"; | |
cargo ${{ matrix.job }} --verbose --manifest-path integration-tests/delegator/${contract}/Cargo.toml; | |
done | |
for contract in ${UPGRADEABLE_CONTRACTS}; do | |
echo "Processing upgradeable contract: $contract"; | |
cargo ${{ matrix.job }} --verbose --manifest-path=integration-tests/upgradeable-contracts/$contract/Cargo.toml; | |
done | |
cargo ${{ matrix.job }} --verbose --manifest-path=integration-tests/upgradeable-contracts/set-code-hash/updated-incrementer/Cargo.toml; | |
for example in integration-tests/*/; do | |
if [ "$example" = "integration-tests/upgradeable-contracts/" ]; then continue; fi; | |
if [ "$example" = "integration-tests/lang-err-integration-tests/" ]; then continue; fi; | |
echo "Processing example: $example"; | |
cargo ${{ matrix.job }} --verbose --manifest-path=$example/Cargo.toml; | |
done |