Skip to content

Commit

Permalink
add wf for contracts tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Magorsky committed Jul 24, 2024
1 parent 37862ef commit e42759c
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/contracts-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Contracts CI - Tests

on:
workflow_dispatch:
pull_request:
paths-ignore:
- 'contracts/**'
- 'docker/**'
push:
paths-ignore:
- 'contracts/**'
- 'docker/**'
branches: [master]

env:
CARGO_TERM_COLOR: always
GEAR_VERSION: 1.4.1

defaults:
run:
working-directory: contracts

permissions:
contents: write
id-token: write
pages: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
all:
name: Tests
runs-on: self-hosted
container:
image: ghcr.io/gear-foundation/dapps/ci-rust:latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
targets: wasm32-unknown-unknown
components: clippy, rustfmt

- name: Prepare Gear Binary
run: |
mkdir -p target/tmp
wget -qO- https://get.gear.rs/gear-v${{ env.GEAR_VERSION }}-x86_64-unknown-linux-gnu.tar.xz| tar xJ -C target/tmp
# mandatory tasks
- name: Fmt
run: 'cargo +nightly fmt --all -- --config imports_granularity=Crate,edition=2021'
- name: Clippy
run: 'cargo clippy --release --workspace --all-targets --all-features -- -D warnings'

# Only on push to master
- name: On Push to master
if: github.ref != 'refs/heads/master'
run: |
cargo test --release --workspace
cargo test --workspace
# Only on push to PR
- name: On Push to Pull Request
if: github.ref != 'refs/heads/master'
run: cargo test --release --workspace

0 comments on commit e42759c

Please sign in to comment.