Skip to content

Commit

Permalink
ci: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Aug 17, 2023
1 parent 1aedf3f commit 66cd1f5
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 4 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cargo fmt --all -- --config format_code_in_doc_comments=true --check

build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: stable
- version: 1.64.0 #MSRV
build-args:
[
-p cashu,
-p cashu --no-default-features,
-p cashu --no-default-features --features wallet,
-p cashu --no-default-features --features mint,
-p cashu-sdk,
-p cashu-sdk --no-default-features,
-p cashu-sdk --features blocking,
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust.version }}
- name: Set profile
run: rustup set profile minimal && rustup component add clippy
- name: Build
run: cargo build ${{ matrix.build-args }}
- name: Tests
run: cargo test ${{ matrix.build-args }}
- name: Clippy
run: cargo clippy ${{ matrix.build-args }} -- -D warnings

build-wasm:
name: Build WASM
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: stable
- version: 1.64.0 #MSRV
build-args:
[
-p cashu,
-p cashu-sdk,
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-wasm32-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Set default toolchain
run: rustup default ${{ matrix.rust.version }}
- name: Add WASM
run: rustup target add wasm32-unknown-unknown
- name: Set profile
run: rustup set profile minimal && rustup component add clippy
- name: Build
run: cargo build ${{ matrix.build-args }} --target wasm32-unknown-unknown
- name: Clippy
run: cargo clippy ${{ matrix.build-args }} --target wasm32-unknown-unknown -- -D warnings
4 changes: 0 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ jobs:
uses: crate-ci/[email protected]
- name: Run fmt
run: cargo fmt --all --check
- name: Run clippy
run: |
rustup component add clippy
cargo clippy --all

0 comments on commit 66cd1f5

Please sign in to comment.