diff --git a/.github/workflows/general_checks.yml b/.github/workflows/general_checks.yml new file mode 100644 index 0000000..c2e333e --- /dev/null +++ b/.github/workflows/general_checks.yml @@ -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 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 4eb52f4..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Rust - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose --all-features diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6a1cf5..b0473f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,8 @@ -on: [push, pull_request] +on: + pull_request: + paths: ['sube/**'] -name: Continuous integration +name: Sube jobs: check: @@ -9,57 +11,8 @@ jobs: 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: Check + run: just -f sube/justfile lint diff --git a/justfile b/justfile index 8972194..b85c08d 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,16 @@ +default: check + +check: check-sube + +check-sube: + @just -f sube/justfile check lint + +check-scales: + @just -f scales/justfile check lint + +check-libwallet: + @just -f libwallet/justfile check lint + build-web: @mkdir -p dist cargo build --release --target wasm32-unknown-unknown diff --git a/libwallet/justfile b/libwallet/justfile index f084758..b49c6a7 100644 --- a/libwallet/justfile +++ b/libwallet/justfile @@ -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 diff --git a/scales/justfile b/scales/justfile new file mode 100644 index 0000000..1456ed8 --- /dev/null +++ b/scales/justfile @@ -0,0 +1,7 @@ +default: check + +check: + cargo check + +lint: + cargo clippy -- -D warnings diff --git a/sube/justfile b/sube/justfile new file mode 100644 index 0000000..1456ed8 --- /dev/null +++ b/sube/justfile @@ -0,0 +1,7 @@ +default: check + +check: + cargo check + +lint: + cargo clippy -- -D warnings