xfy 99e1f2e98d
Some checks failed
CI / build (push) Has been cancelled
CI / check (push) Has been cancelled
ci: avoid actions/setup-node, install node via nodesource
2026-06-12 16:41:38 +08:00

75 lines
1.8 KiB
YAML

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Install Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install Dioxus CLI
run: cargo install dioxus-cli --locked
- name: Install Tailwind CSS CLI
run: npm install -g tailwindcss
- name: Check formatting
run: cargo fmt -- --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --all-features
- name: Dioxus check
run: dx check
build:
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Node.js
run: |
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
- name: Install Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install Dioxus CLI
run: cargo install dioxus-cli --locked
- name: Install Tailwind CSS CLI
run: npm install -g tailwindcss
- name: Build release
run: make build