Forgejo Action: Run npm and cargo commands in the CI.
This commit is contained in:
parent
2880391c8c
commit
05b8335248
5 changed files with 4400 additions and 1 deletions
80
.forgejo/workflows/ci.yml
Normal file
80
.forgejo/workflows/ci.yml
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
name: Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-backend:
|
||||||
|
name: Backend
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: https://codeberg.org/wackbyte/rust-toolchain@trunk
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
components: rustfmt, clippy
|
||||||
|
- run: cd backend
|
||||||
|
- name: Cache
|
||||||
|
uses: https://github.com/Swatinem/rust-cache@v2
|
||||||
|
- name: "Check Format"
|
||||||
|
run: cargo fmt --check
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Build"
|
||||||
|
run: |
|
||||||
|
# hurl needs libxml needs libclang
|
||||||
|
apt update && apt install -y clang
|
||||||
|
cargo build --tests
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Lint"
|
||||||
|
run: |
|
||||||
|
rustup component add clippy
|
||||||
|
cargo clippy
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Unit Tests"
|
||||||
|
run: |
|
||||||
|
cargo test -- --skip api
|
||||||
|
working-directory: backend
|
||||||
|
- name: "Integration Tests"
|
||||||
|
run: cargo test --test api
|
||||||
|
working-directory: backend
|
||||||
|
|
||||||
|
check-frontend:
|
||||||
|
name: Frontend
|
||||||
|
runs-on: docker
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Install Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
cache: "npm"
|
||||||
|
cache-dependency-path: 'frontend/package-lock.json'
|
||||||
|
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 || echo "Failed"
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
.claude/settings.local.json
|
.claude/settings.local.json
|
||||||
|
target/
|
||||||
|
|
|
||||||
4315
Cargo.lock
generated
Normal file
4315
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
3
Cargo.toml
Normal file
3
Cargo.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[workspace]
|
||||||
|
resolver = "3"
|
||||||
|
members = ["backend"]
|
||||||
2
justfile
2
justfile
|
|
@ -23,7 +23,7 @@ fmt: fmt-backend fmt-frontend
|
||||||
|
|
||||||
fmt-check: fmt-check-backend fmt-check-frontend
|
fmt-check: fmt-check-backend fmt-check-frontend
|
||||||
|
|
||||||
lint: lint-backend lint-frontend
|
lint: lint-backend lint-frontend typecheck-frontend
|
||||||
|
|
||||||
check: fmt-check lint test
|
check: fmt-check lint test
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue