update #34
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test | |
| on: | |
| push: | |
| branches: | |
| - "dev/*" | |
| workflow_call: | |
| inputs: | |
| run_tests: | |
| description: "Whether to run tests" | |
| required: false | |
| type: boolean | |
| default: true | |
| fail_on_test_failure: | |
| description: "Whether to fail the workflow if tests fail" | |
| required: false | |
| type: boolean | |
| default: true | |
| outputs: | |
| backend_success: | |
| description: "Whether backend build was successful" | |
| value: ${{ jobs.build-and-test.outputs.backend_success }} | |
| frontend_success: | |
| description: "Whether frontend build was successful" | |
| value: ${{ jobs.build-and-test.outputs.frontend_success }} | |
| backend_tests_success: | |
| description: "Whether backend tests were successful" | |
| value: ${{ jobs.build-and-test.outputs.backend_tests_success }} | |
| frontend_tests_success: | |
| description: "Whether frontend tests were successful" | |
| value: ${{ jobs.build-and-test.outputs.frontend_tests_success }} | |
| jobs: | |
| build-and-test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backend_success: ${{ steps.backend-build.outcome == 'success' }} | |
| frontend_success: ${{ steps.frontend-build.outcome == 'success' }} | |
| backend_tests_success: ${{ steps.backend-test.outcome == 'success' || (inputs.run_tests != true && inputs.run_tests != null) }} | |
| frontend_tests_success: ${{ steps.frontend-test.outcome == 'success' || (inputs.run_tests != true && inputs.run_tests != null) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: ./.github/actions/setup-bun-version | |
| # Install Dependencies | |
| - name: Install Dependencies (Workspace) | |
| run: | | |
| echo "📦 Installing all dependencies via workspace..." | |
| bun install | |
| # Backend Build | |
| - name: Build Backend | |
| id: backend-build | |
| run: | | |
| echo "🔨 Building backend..." | |
| cd backend | |
| bun run build | |
| - name: Generate Client APIs | |
| run: | | |
| echo "🔨 Generating client APIs..." | |
| bun run generate:ui | |
| # Frontend Build | |
| - name: Build Frontend | |
| id: frontend-build | |
| env: | |
| TAILWIND_DISABLE_LIGHTNINGCSS: "1" | |
| run: | | |
| echo "🔨 Building frontend..." | |
| cd ui | |
| bun run build | |
| # Backend Tests | |
| - name: Test Backend | |
| if: ${{ inputs.run_tests == true || inputs.run_tests == null }} | |
| id: backend-test | |
| continue-on-error: ${{ !inputs.fail_on_test_failure }} | |
| run: | | |
| echo "🧪 Testing backend..." | |
| cd backend | |
| bun run test | |
| # Frontend Tests | |
| - name: Test Frontend | |
| if: ${{ inputs.run_tests == true || inputs.run_tests == null }} | |
| id: frontend-test | |
| continue-on-error: ${{ !inputs.fail_on_test_failure }} | |
| env: | |
| TAILWIND_DISABLE_LIGHTNINGCSS: "1" | |
| run: | | |
| echo "🧪 Testing frontend..." | |
| cd ui | |
| bun run test | |
| - name: Upload Build Artifacts | |
| if: ${{ !startsWith(github.ref, 'refs/heads/dev/') }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| backend/dist | |
| ui/dist | |
| retention-days: 7 |