61 lines
1.4 KiB
YAML
61 lines
1.4 KiB
YAML
name: Check
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUSTFLAGS: "-Dwarnings"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v4.2.0
|
|
with:
|
|
node-version: "22.x"
|
|
check-latest: true
|
|
|
|
- name: Setup rust
|
|
run: |
|
|
cargo install sqlx-cli cargo-machete
|
|
cd sync-server
|
|
sqlx database create --database-url sqlite://db.sqlite3
|
|
sqlx migrate run --source src/app_state/database/migrations --database-url sqlite://db.sqlite3
|
|
|
|
- name: Lint sync-server
|
|
run: |
|
|
cd sync-server
|
|
cargo clippy --all-targets --all-features
|
|
cargo fmt --all -- --check
|
|
cargo machete
|
|
|
|
- name: Test sync-server
|
|
run: |
|
|
cd sync-server
|
|
cargo test --verbose
|
|
|
|
- name: Lint frontend
|
|
run: |
|
|
cd frontend
|
|
npm ci
|
|
npm run build
|
|
npm run lint
|
|
if [[ $(git status --porcelain) ]]; then
|
|
git status --porcelain
|
|
echo "Failing CI because the working directory is not clean after linting"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Test frontend
|
|
run: |
|
|
cd frontend
|
|
npm ci
|
|
npm run test
|