fix(nx-payload): serve target should detect file changes #1019
This file contains 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: E2E matrix | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
merge_group: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
preinstall: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
node: [20] | |
name: Cache install (${{ matrix.os }}, node v${{ matrix.node }}) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'yarn' | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v4 | |
with: | |
lookup-only: true | |
path: '**/node_modules' | |
key: ${{ matrix.os }}-modules-${{ matrix.node }}-${{ github.run_id }} | |
- name: Install packages | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
e2e: | |
needs: preinstall | |
permissions: | |
contents: read | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 90 | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
node: [20] | |
pm: [npm, pnpm, yarn] | |
project: [nx-payload-e2e] | |
include: | |
- os: ubuntu-latest | |
name: Linux | |
timeout: 30 | |
configuration: 'skip-docker' | |
verdaccio: localhost | |
- os: macos-latest | |
name: macOS | |
timeout: 30 | |
configuration: skip-docker | |
- os: windows-latest | |
name: Windows | |
timeout: 60 | |
configuration: skip-docker | |
exclude: | |
- os: macos-latest | |
pm: pnpm | |
- os: macos-latest | |
pm: yarn | |
- os: windows-latest | |
pm: pnpm | |
- os: windows-latest | |
pm: yarn | |
fail-fast: false | |
name: E2E ${{ matrix.os }}/${{ matrix.pm }}/${{ matrix.node }} ${{ join(matrix.project) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install PNPM | |
run: npm install -g @pnpm/exe@8 | |
- name: Use Node.js ${{ matrix.node }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'yarn' | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-modules-${{ matrix.node }}-${{ github.run_id }} | |
- name: Install packages | |
run: yarn install --immutable | |
- name: Run e2e tests | |
id: e2e-run | |
run: yarn nx e2e ${{ matrix.project }} -c ${{ matrix.configuration }} | |
timeout-minutes: ${{ matrix.timeout }} | |
env: | |
CDWR_E2E_PACKAGE_MANAGER: ${{ matrix.pm }} | |
CDWR_E2E_VERDACCIO_HOST: ${{ matrix.verdaccio }} | |
CDWR_DEBUG_LOGGING: 'true' | |
NX_CACHE_DIRECTORY: 'tmp' | |
NX_PERF_LOGGING: 'false' | |
NX_NO_CLOUD: ${{ contains(github.head_ref || github.ref_name, 'renovate') || vars.NX_NO_CLOUD == 'true' }} | |
# NX_DAEMON defaults to 'true' unless explicitly set to 'false' | |
NX_DAEMON: ${{ env.NX_DAEMON == 'false' && 'false' || 'true' }} | |
# NX_VERBOSE_LOGGING defaults to 'false' unless explicitly set to 'true' | |
NX_VERBOSE_LOGGING: ${{ vars.NX_VERBOSE_LOGGING == 'true' && 'true' || 'false' }} | |
# Yarn workarounds | |
YARN_ENABLE_HARDENED_MODE: ${{ vars.YARN_ENABLE_HARDENED_MODE == 'true' && 1 || 0 }} | |
# TODO: fix flaky yarn lock issues when running `create-nx-workspace` | |
YARN_ENABLE_IMMUTABLE_INSTALLS: ${{ vars.YARN_ENABLE_IMMUTABLE_INSTALLS }} | |
- name: Save test result | |
if: always() | |
run: | | |
echo '{"os": "${{ matrix.os }}", "pm": "${{ matrix.pm }}", "node": "${{ matrix.node }}", "configuration": "${{ matrix.configuration }}", "status": "${{ job.status }}"}' > results-${{ matrix.os }}-${{ matrix.pm }}-${{ matrix.node }}.json | |
shell: bash | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: results-${{ matrix.os }}-${{ matrix.pm }}-${{ matrix.node }} | |
path: results-${{ matrix.os }}-${{ matrix.pm }}-${{ matrix.node }}.json | |
summary: | |
name: E2E Test Summary | |
needs: e2e | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
pattern: results-* | |
merge-multiple: true | |
- name: Create summary | |
run: | | |
echo "# E2E Test Results Summary" > summary.md | |
echo "" >> summary.md | |
echo "| OS | Package Manager | Node Version | Configuration | Status |" >> summary.md | |
echo "|----|-----------------|--------------| ------------ | ------ |" >> summary.md | |
for artifact in artifacts/*.json; do | |
if [ -f "$artifact" ]; then | |
os=$(jq -r '.os' "$artifact") | |
pm=$(jq -r '.pm' "$artifact") | |
configuration=$(jq -r '.configuration' "$artifact") | |
node=$(jq -r '.node' "$artifact") | |
status=$(jq -r '.status' "$artifact") | |
echo "| $os | $pm | $node | $configuration | $status |" >> summary.md | |
fi | |
done | |
echo "" >> summary.md | |
echo "## Detailed Results" >> summary.md | |
echo "" >> summary.md | |
echo "<details><summary>Click to expand</summary>" >> summary.md | |
for artifact in artifacts/*.json; do | |
echo "$(basename $artifact)" >> summary.md | |
echo "" >> summary.md | |
echo '```json' >> summary.md | |
echo "" >> summary.md | |
jq -s '.' $artifact >> summary.md | |
echo "" >> summary.md | |
echo '```' >> summary.md | |
echo "" >> summary.md | |
done | |
echo "</details>" >> summary.md | |
- name: Upload summary artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: e2e-test-summary | |
path: summary.md | |
- name: Output summary | |
run: cat summary.md >> $GITHUB_STEP_SUMMARY |