feat(turbo): add new task handling functionality #1419
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: CI | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the main branch | |
| pull_request: | |
| branches: [main, 'main-ee', release*, 'temporary/**'] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| checker: | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| if: ${{ !contains(github.event.pull_request.title, '[skip checker]') }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| uses: ./.github/actions/catch-install-pnpm | |
| - name: Build dms-kit (required for checker) | |
| run: pnpm turbo run build --filter=@actiontech/dms-kit | |
| - name: Code lint checker | |
| run: pnpm run checker | |
| test-ee: | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| if: ${{ !contains(github.event.pull_request.title, '[skip checker]') }} | |
| strategy: | |
| matrix: | |
| shard: [1, 2, 3, 4] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| uses: ./.github/actions/catch-install-pnpm | |
| - name: Build dms-kit (required for tests) | |
| run: pnpm turbo run build --filter=@actiontech/dms-kit | |
| - name: Coverage test report ee | |
| run: sh ./scripts/jest/run-ci-ee.sh ${{ matrix.shard }} ${{ strategy.job-total }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-artifacts-${{ matrix.shard }} | |
| path: coverage/ | |
| test-ce: | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| if: ${{ !contains(github.event.pull_request.title, '[skip checker]') }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| uses: ./.github/actions/catch-install-pnpm | |
| - name: Build dms-kit (required for tests) | |
| run: pnpm turbo run build --filter=@actiontech/dms-kit | |
| - name: Coverage test report ce | |
| run: sh ./scripts/jest/run-ci-ce.sh | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ce-coverage-artifacts | |
| path: ce_coverage/ | |
| report: | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
| if: ${{ !contains(github.event.pull_request.title, '[skip checker]') }} | |
| needs: [test-ee, test-ce] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Get CE Coverage | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ce-coverage-artifacts | |
| path: ce_coverage | |
| - name: Get EE Coverage 1 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-artifacts-1 | |
| path: coverage | |
| - name: Get EE Coverage 2 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-artifacts-2 | |
| path: coverage | |
| - name: Get EE Coverage 3 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-artifacts-3 | |
| path: coverage | |
| - name: Get EE Coverage 4 | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-artifacts-4 | |
| path: coverage | |
| - name: Install dependencies | |
| uses: ./.github/actions/catch-install-pnpm | |
| - name: Merge coverage reports | |
| run: node ./scripts/jest/merge-report-json.js | |
| - name: Coverage test report | |
| uses: ArtiomTr/jest-coverage-report-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| base-coverage-file: coverage-merged.json | |
| coverage-file: coverage-merged.json | |
| - name: Delete artifact | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: | | |
| ce-coverage-artifacts | |
| coverage-artifacts-1 | |
| coverage-artifacts-2 | |
| coverage-artifacts-3 | |
| coverage-artifacts-4 |