diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e4afde7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,62 @@ +name: Test & Release + +on: + push: + branches: [ main ] + pull_request: + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: '-D warnings' + CARGO_INCREMENTAL: 0 + RUST_BACKTRACE: short + +jobs: + clippy: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + - name: Run clippy + run: cargo clippy --all-targets -- -D clippy::all -D clippy::nursery + + cargo-fmt: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + - name: Run cargo fmt + run: cargo fmt --check + + # there're sometimes warnings, which signal, that the generated doc + # won't look as expected, when rendered, and sometimes errors, which will prevent doc from being + # generated at release time altogether. + cargo-doc: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + - name: run cargo doc + run: RUSTDOCFLAGS="-D warnings" cargo doc + + test: + needs: cargo-fmt + strategy: + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + toolchain: [stable] + runs-on: ${{ matrix.platform }} + + steps: + - uses: actions/checkout@v2 + - name: "${{ matrix.toolchain }}" + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + default: true + - uses: Swatinem/rust-cache@v1 + - name: Check with stable features + run: cargo check --verbose + - name: Run tests with unstable features + run: cargo test --verbose diff --git a/README.md b/README.md index 66f6543..7e03670 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Currently, the library provides: The library is already usable and might be used for rapid prototyping, it lacks some points to make it production-ready: - [ ] documentation + examples - [ ] integration tests for all API calls -- [ ] CI/CD +- [x] CI - [x] anyhow -> thiserror - [x] ledger is blocking and it's not good in the async runtime - [ ] secure keychain is not that straightforward to use