Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #81

Merged
merged 16 commits into from
Dec 4, 2023
35 changes: 18 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ on:

jobs:
checks:
name: Run clippy and unit tests
name: Uint and e2e tests + linit
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Cache Crates
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-substrate-contracts-node-${{ hashFiles('rust-toolchain.toml') }}

- name: Install Rust toolchain
uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1
# - name: Install Rust toolchain
# run: |
# rustup component add rust-src

- name: Run cargo fmt
uses: actions-rs/cargo@v1
Expand All @@ -35,23 +38,21 @@ jobs:
command: clippy
# args: --all-targets -- --no-deps -D warnings (TODO: fix clippy warnings first)

# sudo apt update && apt upgrade -y
- name: Check if substrate-contracts-node exists
id: check-substrate-contracts-node
continue-on-error: true
run: substrate-contracts-node --version

- name: Install Protobuf
if: ${{ steps.check-substrate-contracts-node.outcome == 'failure' }}
run: |
sudo apt-get install -y protobuf-compiler libprotobuf-dev

- name: Add installing required dependency

- name: Install substrate-contracts-node
if: ${{ steps.check-substrate-contracts-node.outcome == 'failure' }}
run: |
cargo install cargo-dylint dylint-link

- name: Install substrate-contracts-node
uses: actions-rs/cargo@v1
with:
command: install
args: --force --locked contracts-node

# TODO: cache substrate-contracts-node OR downlaod binary from github release
# args: --locked substrate-contracts-node
cargo install --force --locked contracts-node

- name: Run unit tests
uses: actions-rs/cargo@v1
Expand All @@ -60,7 +61,7 @@ jobs:
args: --features e2e-tests

build:
name: Build the contract
name: Release build the contract
runs-on: ubuntu-latest

steps:
Expand Down
Loading