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

83 lines
2.5 KiB
YAML
Raw Normal View History

2024-02-07 02:20:35 +00:00
on:
push:
pull_request:
branches:
- main
jobs:
2024-02-07 20:02:51 +00:00
zigbuild:
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
-
name: Install rustup and rust
uses: https://github.com/dtolnay/rust-toolchain@1.75.0
2024-02-07 20:39:34 +00:00
with:
targets: x86_64-unknown-linux-musl,armv7-unknown-linux-musleabihf,aarch64-unknown-linux-musl
2024-02-07 20:49:19 +00:00
components: clippy
2024-02-07 20:57:27 +00:00
-
name: Install cargo-binstall
uses: https://github.com/taiki-e/install-action@v2
2024-02-07 20:39:34 +00:00
with:
tool: cargo-binstall
2024-02-07 20:57:27 +00:00
-
name: Install zig
uses: https://github.com/goto-bus-stop/setup-zig@v2
with:
version: 0.11.0
-
name: Install cargo-zigbuild
2024-02-07 21:04:55 +00:00
run: yes | cargo binstall cargo-zigbuild
2024-02-07 20:57:27 +00:00
-
name: Compile
run: |
2024-02-07 20:24:03 +00:00
cargo zigbuild --target x86_64-unknown-linux-musl ;
cargo zigbuild --target armv7-unknown-linux-musleabihf ;
cargo zigbuild --target aarch64-unknown-linux-musl ;
cargo clippy --no-default-features -- -D warnings ;
2024-02-07 19:52:21 +00:00
2024-02-07 02:20:35 +00:00
clippy:
runs-on: docker
container:
image: docker.io/asonix/rust-builder:latest-linux-amd64
steps:
2024-02-07 02:49:39 +00:00
- run: |
2024-02-07 03:58:49 +00:00
git clone ${{ env.github_server_url }}/${{ env.github_repository }} .
2024-02-07 04:11:14 +00:00
git checkout ${{ env.github_sha }}
2024-02-07 02:49:39 +00:00
rustup component add clippy
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:
runs-on: docker
container:
image: docker.io/asonix/rust-builder:latest-linux-amd64
steps:
2024-02-07 03:57:43 +00:00
- run: |
2024-02-07 03:58:49 +00:00
git clone ${{ env.github_server_url }}/${{ env.github_repository }} .
2024-02-07 04:11:14 +00:00
git checkout ${{ env.github_sha }}
2024-02-07 03:57:43 +00:00
cargo test
2024-02-07 04:02:57 +00:00
2024-02-07 04:15:15 +00:00
check:
strategy:
matrix:
2024-02-07 04:18:27 +00:00
include:
- image: docker.io/asonix/rust-builder:latest-linux-amd64
target: x86_64-unknown-linux-musl
- image: docker.io/asonix/rust-builder:latest-linux-arm32v7
target: armv7-unknown-linux-musleabihf
- image: docker.io/asonix/rust-builder:latest-linux-arm64v8
2024-02-07 04:26:09 +00:00
target: aarch64-unknown-linux-musl
2024-02-07 04:02:57 +00:00
runs-on: docker
container:
2024-02-07 04:15:15 +00:00
image: ${{ matrix.image }}
2024-02-07 04:02:57 +00:00
steps:
- run: |
git clone ${{ env.github_server_url }}/${{ env.github_repository }} .
2024-02-07 04:11:14 +00:00
git checkout ${{ env.github_sha }}
2024-02-07 04:15:15 +00:00
cargo check --target ${{ matrix.target }}