Some checks failed
Test / get-ci-image (pull_request) Successful in 14s
Test / test-frontend (pull_request) Successful in 47s
Verify / get-ci-image (pull_request) Successful in 6s
Test / lint-frontend (pull_request) Successful in 1m14s
Verify / verify-generated-db-entities (pull_request) Failing after 15m14s
Test / frontend-build (pull_request) Failing after 19m51s
Test / test-crates (pull_request) Has been skipped
Test / lint-crates (pull_request) Has been skipped
Co-authored-by: Copilot <copilot@github.com>
164 lines
4.0 KiB
YAML
164 lines
4.0 KiB
YAML
# this workflow runs tests on pull request and push events targeting master branch
|
|
# it also verify the generated code is up to date and valid
|
|
|
|
name: Test
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
get-ci-image:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
image_tag: ${{ steps.setup.outputs.image_tag }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup CI metadata
|
|
id: setup
|
|
uses: ./.github/actions/setup-ci-metadata
|
|
with:
|
|
registry: ${{ secrets.OVERRIDE_REGISTRY }}
|
|
image_tag: latest
|
|
|
|
test-crates:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- frontend-build
|
|
- get-ci-image
|
|
container:
|
|
image: ${{ needs.get-ci-image.outputs.image_tag }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Rust, checkout and restore caches
|
|
uses: ./.github/actions/setup-rust
|
|
|
|
- name: Download frontend build artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: frontend-build
|
|
path: apps/nxmesh-frontend/dist
|
|
|
|
- name: Copy frontend build to expected location
|
|
run: |
|
|
# unlink frontend-dist
|
|
rm -f apps/nxmesh-master/frontend-dist || true
|
|
rm -rf apps/nxmesh-master/frontend-dist || true
|
|
cp -r apps/nxmesh-frontend/dist apps/nxmesh-master/frontend-dist
|
|
|
|
ls -la apps/nxmesh-master/frontend-dist
|
|
|
|
- name: Run tests
|
|
run: cargo test --all-features -- --show-output
|
|
|
|
lint-crates:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- frontend-build
|
|
- get-ci-image
|
|
container:
|
|
image: ${{ needs.get-ci-image.outputs.image_tag }}
|
|
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 artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: frontend-build
|
|
path: apps/nxmesh-frontend/dist
|
|
|
|
- name: Copy frontend build to expected location
|
|
run: |
|
|
# unlink frontend-dist
|
|
rm -f apps/nxmesh-master/frontend-dist || true
|
|
rm -rf apps/nxmesh-master/frontend-dist || true
|
|
cp -r apps/nxmesh-frontend/dist apps/nxmesh-master/frontend-dist
|
|
|
|
- name: Run clippy
|
|
run: cargo clippy --all-features
|
|
|
|
- name: Check code formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
lint-frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
name: Install Bun
|
|
|
|
- name: Install frontend dependencies
|
|
run: |
|
|
cd apps/nxmesh-frontend
|
|
bun install
|
|
|
|
- name: Run frontend linter
|
|
run: |
|
|
cd apps/nxmesh-frontend
|
|
bun run lint
|
|
|
|
test-frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
name: Install Bun
|
|
|
|
- name: Install frontend dependencies
|
|
run: |
|
|
cd apps/nxmesh-frontend
|
|
bun install
|
|
|
|
- name: Run frontend tests
|
|
run: |
|
|
cd apps/nxmesh-frontend
|
|
bun run test
|
|
|
|
frontend-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
name: Install Bun
|
|
|
|
- name: Install frontend dependencies
|
|
run: |
|
|
cd apps/nxmesh-frontend
|
|
bun install
|
|
|
|
- name: Build frontend
|
|
run: |
|
|
cd apps/nxmesh-frontend
|
|
bun run build
|
|
|
|
- name: Upload frontend build artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: frontend-build
|
|
path: apps/nxmesh-frontend/dist
|