Forgejo Action: Run npm and cargo commands in the CI.
This commit is contained in:
parent
2880391c8c
commit
98638f8c52
1 changed files with 66 additions and 0 deletions
66
.forgejo/workflows/ci.yml
Normal file
66
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-backend:
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: https://codeberg.org/wackbyte/rust-toolchain@trunk
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
components: rustfmt, clippy
|
||||||
|
- name: "Check Format"
|
||||||
|
run: cargo fmt --check
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Lint"
|
||||||
|
run: |
|
||||||
|
rustup component add clippy
|
||||||
|
cargo clippy
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Unit Tests"
|
||||||
|
run: |
|
||||||
|
# libxml needs libclang
|
||||||
|
apt install clang
|
||||||
|
cargo test -- --skip api
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Integration Tests"
|
||||||
|
run: cargo test --test api
|
||||||
|
working-directory: backend
|
||||||
|
|
||||||
|
check-frontend:
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
|
- name: Check Format
|
||||||
|
run: "npm run format:check"
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: npm run typecheck
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue