From e10f0d25c46a06affcd74502f322e2782f7abf8c Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Wed, 24 Sep 2025 01:36:12 -0700 Subject: [PATCH] Forgejo Action: Run npm and cargo commands in the CI. --- .forgejo/workflows/ci.yml | 66 +++++++++++++++++++++++++++++++++++++++ justfile | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/ci.yml diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..2047816 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -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: | + # hurl needs libxml needs libclang + apt update && apt install -y 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 || echo "Failed" + working-directory: frontend + + - name: Test + run: npm run test + working-directory: frontend + diff --git a/justfile b/justfile index ad5f466..28dce57 100644 --- a/justfile +++ b/justfile @@ -23,7 +23,7 @@ fmt: fmt-backend fmt-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