Merge pull request #17 from Unity-Lab-AI/codex/fix-voice-playback-on-… #76
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: Main Branch Delivery | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build and Upload Artifacts | |
| runs-on: ubuntu-latest | |
| env: | |
| POLLI_TOKEN: ${{ secrets.POLLI_TOKEN || secrets.VITE_POLLI_TOKEN || secrets.POLLINATIONS_TOKEN || secrets.VITE_POLLINATIONS_TOKEN }} | |
| VITE_POLLI_TOKEN: ${{ secrets.VITE_POLLI_TOKEN || secrets.POLLI_TOKEN || secrets.VITE_POLLINATIONS_TOKEN || secrets.POLLINATIONS_TOKEN }} | |
| POLLINATIONS_TOKEN: ${{ secrets.POLLINATIONS_TOKEN || secrets.POLLI_TOKEN || secrets.VITE_POLLINATIONS_TOKEN || secrets.VITE_POLLI_TOKEN }} | |
| VITE_POLLINATIONS_TOKEN: ${{ secrets.VITE_POLLINATIONS_TOKEN || secrets.POLLINATIONS_TOKEN || secrets.VITE_POLLI_TOKEN || secrets.POLLI_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Write version file | |
| run: node tools/write-version.mjs | |
| - name: Build | |
| run: npm run build | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist | |
| report-build-status: | |
| name: Report Build Status | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: always() | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Report Build Status | |
| run: node tools/report-build-status.mjs | |
| env: | |
| BUILD_RESULT: ${{ needs.build.result }} | |
| tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| continue-on-error: true | |
| env: | |
| POLLI_TOKEN: ${{ secrets.POLLI_TOKEN || secrets.VITE_POLLI_TOKEN || secrets.POLLINATIONS_TOKEN || secrets.VITE_POLLINATIONS_TOKEN }} | |
| VITE_POLLI_TOKEN: ${{ secrets.VITE_POLLI_TOKEN || secrets.POLLI_TOKEN || secrets.VITE_POLLINATIONS_TOKEN || secrets.POLLINATIONS_TOKEN }} | |
| POLLINATIONS_TOKEN: ${{ secrets.POLLINATIONS_TOKEN || secrets.POLLI_TOKEN || secrets.VITE_POLLINATIONS_TOKEN || secrets.VITE_POLLI_TOKEN }} | |
| VITE_POLLINATIONS_TOKEN: ${{ secrets.VITE_POLLINATIONS_TOKEN || secrets.POLLINATIONS_TOKEN || secrets.VITE_POLLI_TOKEN || secrets.POLLI_TOKEN }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run Tests | |
| run: npm test | |
| - name: Upload test report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: main-branch-test-results | |
| path: reports/test-results.json | |
| if-no-files-found: warn | |
| deploy: | |
| name: Deploy to Pages | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: ${{ needs.build.result == 'success' }} | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| report-tests: | |
| name: Report Tests Statuses | |
| runs-on: ubuntu-latest | |
| needs: tests | |
| if: always() | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download test report | |
| uses: actions/download-artifact@v4 | |
| continue-on-error: true | |
| with: | |
| name: main-branch-test-results | |
| path: reports | |
| - name: Report Tests Statuses | |
| run: node tools/report-tests.mjs --title "Main Branch Test Results" --results reports/test-results.json |