Files
2026-08-25 20:10:03 +00:00

41 lines
1.3 KiB
YAML

name: CI
on:
push:
branches: [master]
pull_request:
jobs:
build:
runs-on: amd64
steps:
- name: Install node
run: |
if command -v apk >/dev/null 2>&1; then
apk add --no-cache nodejs npm
elif command -v apt-get >/dev/null 2>&1; then
apt-get update && apt-get install -y nodejs npm
else
echo "No package manager found, assuming node present"
fi
- uses: actions/checkout@v4
- name: Install Rust
run: |
if command -v rustc >/dev/null 2>&1 && command -v cargo >/dev/null 2>&1; then
echo "Rust already present"
elif command -v apk >/dev/null 2>&1; then
apk add --no-cache rust rustfmt rust-clippy
elif command -v apt-get >/dev/null 2>&1; then
apt-get update && apt-get install -y rustc cargo rustfmt rust-clippy
else
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --component rustfmt,clippy
fi
- name: cargo check
run: cargo check
- name: cargo clippy
run: cargo clippy -- -D warnings
- name: cargo test
run: cargo test
- name: cargo fmt --check
run: cargo fmt -- --check