pict-rs/.forgejo/workflows/check.yaml

122 lines
3.2 KiB
YAML
Raw Normal View History

2024-02-07 02:20:35 +00:00
on:
push:
pull_request:
branches:
- main
jobs:
2024-02-07 21:45:31 +00:00
cache-rust:
runs-on: docker
container:
image: docker.io/node:20-bookworm
steps:
-
name: Install rustup and rust
id: rust
uses: https://github.com/dtolnay/rust-toolchain@1.75.0
with:
components: clippy
targets: x86_64-unknown-linux-musl,armv7-unknown-linux-musleabihf,aarch64-unknown-linux-musl
-
name: Install cargo-binstall
uses: https://github.com/taiki-e/install-action@v2
with:
tool: cargo-binstall
-
name: Install cargo-zigbuild
run: yes | cargo binstall cargo-zigbuild
-
name: Populate rust cache
uses: https://github.com/actions/cache/save@v4
with:
2024-02-07 21:46:47 +00:00
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
~/.rustup
2024-02-07 21:48:51 +00:00
key: ${{ runner.os }}-cargo-${{ steps.rust.outputs.cacheKey }}
2024-02-07 21:45:31 +00:00
2024-02-07 21:12:49 +00:00
clippy:
2024-02-07 21:45:31 +00:00
needs: [cache-rust]
2024-02-07 19:52:21 +00:00
runs-on: docker
container:
image: docker.io/node:20-bookworm
steps:
2024-02-07 20:57:27 +00:00
-
name: Checkout pict-rs
uses: https://github.com/actions/checkout@v4
-
2024-02-07 21:45:31 +00:00
name: Fetch rust cache
uses: https://github.com/actions/cache/restore@v4
2024-02-07 20:39:34 +00:00
with:
2024-02-07 21:46:47 +00:00
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
~/.rustup
2024-02-07 21:48:51 +00:00
key: ${{ runner.os }}-cargo-${{ jobs.cache-rust.steps.rust.outputs.cacheKey }}
2024-02-07 20:57:27 +00:00
-
2024-02-07 21:12:49 +00:00
name: Clippy
2024-02-07 20:57:27 +00:00
run: |
2024-02-07 02:49:39 +00:00
cargo clippy --no-default-features -- -D warnings
cargo clippy --no-default-features --features io-uring -- -D warnings
2024-02-07 02:20:35 +00:00
tests:
2024-02-07 21:45:31 +00:00
needs: [cache-rust]
2024-02-07 02:20:35 +00:00
runs-on: docker
container:
2024-02-07 21:12:49 +00:00
image: docker.io/node:20-bookworm
2024-02-07 02:20:35 +00:00
steps:
2024-02-07 21:12:49 +00:00
-
name: Checkout pict-rs
uses: https://github.com/actions/checkout@v4
-
name: Install rustup and rust
uses: https://github.com/dtolnay/rust-toolchain@1.75.0
-
name: Test
run: cargo test
2024-02-07 04:02:57 +00:00
2024-02-07 04:15:15 +00:00
check:
2024-02-07 21:45:31 +00:00
needs: [cache-rust]
2024-02-07 04:15:15 +00:00
strategy:
matrix:
2024-02-07 21:12:49 +00:00
target:
- x86_64-unknown-linux-musl
- armv7-unknown-linux-musleabihf
- aarch64-unknown-linux-musl
2024-02-07 04:02:57 +00:00
runs-on: docker
container:
2024-02-07 21:12:49 +00:00
image: docker.io/node:20-bookworm
2024-02-07 04:02:57 +00:00
steps:
2024-02-07 21:12:49 +00:00
-
name: Checkout pict-rs
uses: https://github.com/actions/checkout@v4
-
2024-02-07 21:45:31 +00:00
name: Fetch rust cache
uses: https://github.com/actions/cache/restore@v4
2024-02-07 21:12:49 +00:00
with:
2024-02-07 21:46:47 +00:00
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
~/.rustup
2024-02-07 21:48:51 +00:00
key: ${{ runner.os }}-cargo-${{ jobs.cache-rust.steps.rust.outputs.cacheKey }}
2024-02-07 21:12:49 +00:00
-
name: Install cargo-binstall
uses: https://github.com/taiki-e/install-action@v2
with:
tool: cargo-binstall
-
name: Install zig
uses: https://github.com/goto-bus-stop/setup-zig@v2
with:
version: 0.11.0
-
2024-02-07 21:22:17 +00:00
name: Debug builds
2024-02-07 21:27:57 +00:00
run: cargo zigbuild --target ${{ matrix.target }}