From fa052728116aa7299fe8927d34157176cd2a844e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tudor=20Lechin=C8=9Ban?= Date: Sat, 27 Jan 2024 19:54:48 +0200 Subject: [PATCH] ci: re-add continuous integration --- .github/workflows/CI.yml | 77 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..9eecc58 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,77 @@ +name: CI + +on: [ pull_request, push ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + matrix: + toolchain: [ stable, nightly ] + os: [ windows-latest, ubuntu-latest, macos-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-build-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }} + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true + - name: Check all-targets + run: cargo check --all-features --all-targets + - name: Run tests + run: cargo test + + build-wasm: + strategy: + matrix: + toolchain: [ stable, nightly ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-build-wasm-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.toml') }} + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + target: wasm32-unknown-unknown + override: true + - name: Check wasm + uses: actions-rs/cargo@v1 + with: + command: check + args: --target wasm32-unknown-unknown --no-default-features + + check-doc: + runs-on: ubuntu-latest + if: always() + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - name: Installs cargo-deadlinks + run: cargo install --force cargo-deadlinks + - name: Build and check doc + run: RUSTDOCFLAGS='-D warnings' cargo doc --all-features + - name: Checks dead links + run: cargo deadlinks --dir target/doc/sparsey + continue-on-error: true