From 26e5580443eead38bc4e183de94a68fe6cbf92a0 Mon Sep 17 00:00:00 2001 From: gusto Date: Wed, 23 Nov 2022 15:10:17 +0200 Subject: [PATCH] Add CI tests, clippy and fmt checks (#12) Using logos-co/Overwatch CI scripts for tests and linting in PRs. The idea is to use this for now, and later gather all common action definitions into one dedicated repository. * Copied CI test, clippy and fmt steps from Overwatch * Added go 1.19 to an action setup (required for building waku-rust-bindigs dep) --- .github/workflows/main.yml | 77 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..5c4cbfa4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,77 @@ +# copy of https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md +on: [push, pull_request] + +name: CI + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + continue-on-error: false + with: + command: check + + test: + name: Test Suite + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/setup-go@v3 # we need go to build go-waku + with: + go-version: '1.19' + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + continue-on-error: false + with: + command: build + - uses: actions-rs/cargo@v1 + continue-on-error: false + with: + command: test + + lints: + name: Rust lints + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + continue-on-error: false + with: + command: fmt + args: --all -- --check + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + continue-on-error: false + with: + command: clippy + args: -- --deny warnings