Skip to content

Commit

Permalink
General checks on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
olanod committed Jun 12, 2024
1 parent 0a73432 commit 7099446
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 88 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/general_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: General checks

on:
push:
branches: [ main ]
env:
CARGO_TERM_COLOR: always

jobs:
sube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: extractions/setup-just@v2
- name: Check sube
run: just check-sube

scales:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: extractions/setup-just@v2
- name: Check
run: just check-scales

libwallet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: extractions/setup-just@v2
- name: Check
run: just check-libwallet
22 changes: 0 additions & 22 deletions .github/workflows/rust.yml

This file was deleted.

67 changes: 9 additions & 58 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,16 @@
on: [push, pull_request]
on:
pull_request:
paths: ['sube/**']

name: Continuous integration
name: Sube

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --features=std

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- uses: extractions/setup-just@v2
- name: Check
run: just -f sube/justfile check
- name: Lint
run: just -f sube/justfile lint
20 changes: 12 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
build-web:
@mkdir -p dist
cargo build --release --target wasm32-unknown-unknown
@cp ./target/wasm32-unknown-unknown/release/pjs.wasm dist/
wasm-bindgen --out-dir dist --target web --no-typescript --remove-name-section dist/pjs.wasm

test:
cargo test
default: check

check: check-sube check-scales check-libwallet

check-sube:
@just -f sube/justfile check lint

check-scales:
@just -f scales/justfile check lint

check-libwallet:
@just -f libwallet/justfile check lint
6 changes: 6 additions & 0 deletions libwallet/justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
default:
just --choose

check:
cargo check

lint:
cargo clippy -- -D warnings

check-no-std:
cargo build --features substrate --target wasm32-unknown-unknown
cargo build --features substrate --target riscv32i-unknown-none-elf
7 changes: 7 additions & 0 deletions scales/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default: check

check:
cargo check

lint:
cargo clippy -- -D warnings
7 changes: 7 additions & 0 deletions sube/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default: check

check:
cargo check

lint:
cargo clippy -- -D warnings

0 comments on commit 7099446

Please sign in to comment.