# 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 build artifact from previous job uses: actions/download-artifact@v3 with: name: frontend-build-${{ github.run_id }} - name: Run tests run: cargo test --all-features 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 build artifact from previous job uses: actions/download-artifact@v3 with: name: frontend-build-${{ github.run_id }} - 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-${{ github.run_id }} path: apps/nxmesh-frontend/dist