feat(ci): add pkg.pr.new preview releases #678
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: Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - releases/* | |
| pull_request: | |
| env: | |
| NX_BRANCH: ${{ github.event.number }} | |
| NX_RUN_GROUP: ${{ github.run_id }} | |
| jobs: | |
| setup: | |
| uses: ./.github/workflows/shared.setup-env.yml | |
| check: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [ 22.x, 23.x ] | |
| target: [ 'build', 'test', 'lint' ] | |
| steps: | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup-step | |
| - name: GIT config | |
| if: matrix.target == 'build' | |
| run: | | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| - name: nx workspace:version | |
| if: matrix.target == 'build' | |
| run: yarn nx run workspace:version | |
| - name: nx affected:${{ matrix.target }} | |
| run: yarn nx run-many --target=${{ matrix.target }} --all | |
| - name: Codecov | |
| uses: codecov/codecov-action@v2 | |
| if: matrix.target == 'test' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| directory: ./coverage | |
| fail_ci_if_error: false | |
| name: run-unit-test-${{ matrix.node-version }} | |
| e2e-test: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [ 20.x, 21.x ] | |
| db-type: ['postgres', 'mysql'] | |
| steps: | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup-step | |
| - name: docker compose | |
| run: docker compose -f ./examples/docker-compose.yml up -d | |
| - name: nx affected:e2e | |
| run: yarn nx run-many --target=e2e --all | |
| env: | |
| NESTJS_QUERY_DB_TYPE: ${{ matrix.db-type }} | |
| - name: Codecov | |
| uses: codecov/codecov-action@v2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| directory: ./coverage | |
| fail_ci_if_error: false | |
| name: run-e2e-${{ matrix.node-version }}-${{ matrix.db-type }} | |
| federation-e2e-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Docker Compose | |
| uses: docker/setup-compose-action@v1 | |
| - name: Build and run Federation E2E tests | |
| run: | | |
| cd examples/federation-v2-e2e | |
| docker compose --profile test up --build --exit-code-from e2e-test e2e-test | |
| - name: Show logs on failure | |
| if: failure() | |
| run: | | |
| cd examples/federation-v2-e2e | |
| docker compose logs |