Add frontend build artifact handling and linting steps to CI workflow
Some checks failed
Test / verify-generated-code (pull_request) Successful in 55s
Test / test-frontend (pull_request) Successful in 20s
Test / frontend-build (pull_request) Failing after 38s
Test / test (pull_request) Has been skipped
Test / lint (pull_request) Has been skipped

This commit is contained in:
GW_MC
2025-12-02 20:18:48 +08:00
parent 06cabb0e18
commit 0374d63efe
2 changed files with 66 additions and 9 deletions

View File

@@ -44,6 +44,7 @@ jobs:
fi fi
test: test:
needs: frontend-build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
@@ -54,9 +55,42 @@ jobs:
- name: Setup Rust, checkout and restore caches - name: Setup Rust, checkout and restore caches
uses: ./.github/actions/setup-rust uses: ./.github/actions/setup-rust
- name: Download frontend build
uses: actions/download-artifact@v4
with:
name: frontend-build
path: apps/frontend/build
- name: Run tests - name: Run tests
run: cargo test --all-features run: cargo test --all-features
lint:
needs: frontend-build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Rust, checkout and restore caches
uses: ./.github/actions/setup-rust
with:
components: clippy, rustfmt
- name: Download frontend build
uses: actions/download-artifact@v4
with:
name: frontend-build
path: apps/frontend/build
- name: Run clippy
run: cargo clippy --all-features -- -D warnings
- name: Check code formatting
run: cargo fmt --all -- --check
test-frontend: test-frontend:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -88,21 +122,36 @@ jobs:
cd apps/frontend cd apps/frontend
pnpm test pnpm test
lint: frontend-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
with: with:
fetch-depth: 0 version: 10
run_install: false
- name: Setup Rust, checkout and restore caches - name: Setup Node.js
uses: ./.github/actions/setup-rust uses: actions/setup-node@v4
with: with:
components: clippy, rustfmt node-version: 22
cache: 'pnpm'
cache-dependency-path: apps/frontend/pnpm-lock.yaml
- name: Run clippy - name: Install frontend dependencies
run: cargo clippy --all-features -- -D warnings run: |
cd apps/frontend
pnpm install
- name: Check code formatting - name: Build frontend
run: cargo fmt --all -- --check run: |
cd apps/frontend
pnpm build
- name: Upload frontend build artifact
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: apps/frontend/build

View File

@@ -52,3 +52,11 @@ build-backend:
cargo build --release cargo build --release
build: build-frontend build-backend build: build-frontend build-backend
act *args:
if [ -n "{{args}}" ]; then \
act {{args}} --artifact-server-path /tmp/artifacts; \
else \
act; \
fi