Skip to content

chore: add new PR workflow #2866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9cf880a
chore: add new PR workflow
david-luna May 29, 2025
58702ed
chore: test ci:changed scripts
david-luna May 29, 2025
5b4e1b4
chore: upload test artifacts
david-luna May 29, 2025
294b6e4
chore: add logs in coverage step
david-luna May 29, 2025
780ffcd
chore: add job dependency
david-luna May 29, 2025
de2e6ef
chore: fix dependencies in jobs
david-luna May 29, 2025
ad59caf
chore: add missing steps to coverage job
david-luna May 29, 2025
c019193
chore: remove other PR workflows
david-luna May 30, 2025
4d13f2e
chore: add some logs in pr workflow
david-luna Jun 2, 2025
5d79d66
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jun 2, 2025
f57c5c5
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jun 2, 2025
368d918
chore: rename scripts
david-luna Jun 2, 2025
85013e8
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jun 10, 2025
1211d78
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jun 12, 2025
90262a6
Merge branch 'dluna-ci-pr-speed-and-coverage' of github.com:david-lun…
david-luna Jun 12, 2025
652af62
chore: add coverage merge script
david-luna Jun 12, 2025
17ea030
fix: use the new affected scripts
david-luna Jun 12, 2025
03e8c67
chore: update amqplib test script
david-luna Jun 12, 2025
0254c12
chore: update scripts
david-luna Jun 12, 2025
2479414
chore: revert cucumber instr changes
david-luna Jun 12, 2025
cbedab6
chore: add more plugins to coverage
david-luna Jun 12, 2025
22b32f2
chore: add another batch of instrumentations
david-luna Jun 12, 2025
a75ac50
chore: add another round of instrumentations
david-luna Jun 12, 2025
48612c0
chore: add another chunk of instrumentations
david-luna Jun 12, 2025
939bec9
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jun 12, 2025
ddca5a1
chore: add codecov action with dry_run
david-luna Jun 12, 2025
855e679
chore: add flags script
david-luna Jun 13, 2025
ad14f95
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jul 8, 2025
d8068be
chore: update codecov.yml
david-luna Jul 8, 2025
444bee8
chore: rename job to match PR checks
david-luna Jul 8, 2025
e9e1648
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Jul 10, 2025
6f2b9a7
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Aug 1, 2025
7254591
Merge branch 'dluna-ci-pr-speed-and-coverage' of github.com:david-lun…
david-luna Aug 1, 2025
3257370
chore: rename coverage script
david-luna Aug 1, 2025
51afb3e
Merge branch 'main' into dluna-ci-pr-speed-and-coverage
david-luna Aug 1, 2025
1ed7097
chore: add missign peer dependenciy for tav tests in pino
david-luna Aug 1, 2025
0896c53
chore: add tav command to debug
david-luna Aug 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 79 additions & 27 deletions .github/workflows/unit-test.yml → .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Unit Tests
name: Pull Request Tests
on:
push:
branches: [main]
pull_request:
# TODO: remove it
branches: [main]

permissions:
contents: read

jobs:
build-and-cache:
compile:
strategy:
fail-fast: false
runs-on: ubuntu-latest
Expand All @@ -26,19 +26,20 @@ jobs:
node-version: 18
- name: Install
run: npm ci
- name: Build
run: npm run compile
# TODO: check if compiling only the affected modules is correct
- name: Compile (Delta)
run: npm run compile:ci:affected
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: tests-build-cache-${{ github.run_number }}
name: compile-cache-${{ github.run_number }}
path: .nx
include-hidden-files: true
if-no-files-found: error
retention-days: 1

unit-test:
needs: build-and-cache
needs: compile
strategy:
fail-fast: false
matrix:
Expand All @@ -48,9 +49,6 @@ jobs:
- "20.6.0"
- "20"
- "22"
include:
- node: 18
code-coverage: true
runs-on: ubuntu-latest
services:
memcached:
Expand Down Expand Up @@ -184,26 +182,27 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: tests-build-cache-${{ github.run_number }}
name: compile-cache-${{ github.run_number }}
path: .nx
- name: Build
run: npm run compile
- name: Unit tests (Full)
if: matrix.code-coverage
run: npm run test
- name: Compile (Delta)
run: npm run compile:ci:affected
- name: Unit tests (Delta)
if: ${{ !matrix.code-coverage }}
run: npm run test:ci:changed
- name: Report Coverage
if: ${{ matrix.code-coverage && !cancelled()}}
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: npm run test:ci:affected
- name: Test All Versions (Delta)
run: npm run test-all-versions:ci:affected
- name: Upload Test Artifacts
uses: actions/upload-artifact@v4
with:
verbose: true
name: tests-coverage-cache-${{ github.run_number }}-${{ matrix.node }}
include-hidden-files: true
if-no-files-found: error
retention-days: 1
path: |
!node_modules
**/.nyc_output/**

browser-test:
needs: build-and-cache
needs: compile
strategy:
fail-fast: false
matrix:
Expand All @@ -225,7 +224,7 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: tests-build-cache-${{ github.run_number }}
name: compile-cache-${{ github.run_number }}
path: .nx
- name: Build
run: npm run compile
Expand All @@ -237,3 +236,56 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true

test-coverage-report:
runs-on: ubuntu-latest
needs: unit-test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install
run: npm ci
# NOTE: keep this in sync with the node versions from `unit-test` job
# TODO: doownload browser coverage
- name: Download Test Artifacts (18)
uses: actions/download-artifact@v4
with:
name: tests-coverage-cache-${{ github.run_number }}-18
path: .
- name: Download Test Artifacts (18.19.0)
uses: actions/download-artifact@v4
with:
name: tests-coverage-cache-${{ github.run_number }}-18.19.0
path: .
- name: Download Test Artifacts (20)
uses: actions/download-artifact@v4
with:
name: tests-coverage-cache-${{ github.run_number }}-20
path: .
- name: Download Test Artifacts (20.6.0)
uses: actions/download-artifact@v4
with:
name: tests-coverage-cache-${{ github.run_number }}-20.6.0
path: .
- name: Download Test Artifacts (22)
uses: actions/download-artifact@v4
with:
name: tests-coverage-cache-${{ github.run_number }}-22
path: .
- name: Merge coverage (Delta)
run: npm run coverage:merge:ci:affected
- name: Check coverage
run: find . | grep coverage-final

- name: Report Coverage
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
dry_run: true
37 changes: 0 additions & 37 deletions .github/workflows/test-all-versions.pr.yml

This file was deleted.

Loading
Loading