Run presubmit tests in windows as well as linux. (#4672)

Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
Tommaso Sciortino
2025-07-25 15:57:30 -07:00
committed by GitHub
parent fbdc8d5ab3
commit 17331001a0
4 changed files with 96 additions and 115 deletions

View File

@@ -17,6 +17,9 @@ inputs:
node_version:
description: 'Node.js version for context in messages'
required: true
os:
description: 'The os for context in messages'
required: true
github_token:
description: 'GitHub token for posting comments'
required: true
@@ -91,7 +94,7 @@ runs:
echo "</details>" >> "$comment_file"
echo "" >> "$comment_file"
echo "_For detailed HTML reports, please see the 'coverage-reports-${{ inputs.node_version }}' artifact from the main CI run._" >> "$comment_file"
echo "_For detailed HTML reports, please see the 'coverage-reports-${{ inputs.node_version }}-${{ inputs.os }}' artifact from the main CI run._" >> "$comment_file"
- name: Post Coverage Comment
uses: thollander/actions-comment-pull-request@v3

View File

@@ -44,7 +44,7 @@ jobs:
test:
name: Test
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
needs: lint
permissions:
contents: read
@@ -52,6 +52,7 @@ jobs:
pull-requests: write
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout repository
@@ -70,7 +71,9 @@ jobs:
run: npm ci # Install fresh dependencies using the downloaded package-lock.json
- name: Run tests and generate reports
run: NO_COLOR=true npm run test:ci
run: npm run test:ci
env:
NO_COLOR: true
- name: Publish Test Report (for non-forks)
if: always() && (github.event.pull_request.head.repo.full_name == github.repository)
@@ -85,14 +88,14 @@ jobs:
if: always() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository)
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: test-results-fork-${{ matrix.node-version }}
name: test-results-fork-${{ matrix.node-version }}-${{ matrix.os }}
path: packages/*/junit.xml
- name: Upload coverage reports
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: coverage-reports-${{ matrix.node-version }}
name: coverage-reports-${{ matrix.node-version }}-${{ matrix.os }}
path: packages/*/coverage
post_coverage_comment:
@@ -106,7 +109,9 @@ jobs:
pull-requests: write # For commenting
strategy:
matrix:
node-version: [22.x] # Reduce noise by only posting the comment once
# Reduce noise by only posting the comment once
os: [ubuntu-latest]
node-version: [22.x]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -114,7 +119,7 @@ jobs:
- name: Download coverage reports artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: coverage-reports-${{ matrix.node-version }}
name: coverage-reports-${{ matrix.node-version }}-${{ matrix.os }}
path: coverage_artifact # Download to a specific directory
- name: Post Coverage Comment using Composite Action
@@ -125,6 +130,7 @@ jobs:
cli_full_text_summary_file: coverage_artifact/cli/coverage/full-text-summary.txt
core_full_text_summary_file: coverage_artifact/core/coverage/full-text-summary.txt
node_version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
github_token: ${{ secrets.GITHUB_TOKEN }}
codeql: