Skip to content
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

Move if-s to job-level in CI #7033

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
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
16 changes: 3 additions & 13 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,31 @@ jobs:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [18.x, 20.x]
if: ${{ needs.changes.outputs.cms == 'true' }}
steps:
- uses: actions/checkout@v3
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: Use Node.js {{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: log versions
run: node --version && npm --version && yarn --version
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: install dependecies
run: npm install
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: run unit tests
run: npm run test:ci
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: build demo site
run: npm run build:demo
env:
NODE_OPTIONS: --max-old-space-size=4096
if: ${{ needs.changes.outputs.cms == 'true' }}
- uses: actions/upload-artifact@master
with:
name: dev-test-website-${{ runner.os }}-${{ matrix.node-version }}
path: dev-test
if: ${{ needs.changes.outputs.cms == 'true' }}

e2e-with-cypress:
needs: [changes, build]
Expand All @@ -69,27 +63,24 @@ jobs:
node-version: [18.x, 20.x]
fail-fast: false

if: ${{ needs.changes.outputs.cms == 'true' }}
steps:
- uses: actions/checkout@v3
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
if: ${{ needs.changes.outputs.cms == 'true' }}
- uses: actions/download-artifact@master
with:
name: dev-test-website-${{ runner.os }}-18.x
path: dev-test
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: npm install
run: |
node --version
npm --version
yarn --version
npm install
if: ${{ needs.changes.outputs.cms == 'true' }}
- name: e2e test
run: |
npm run test:e2e:run-ci
Expand All @@ -99,9 +90,8 @@ jobs:
NODE_OPTIONS: --max-old-space-size=4096
MACHINE_COUNT: 2
MACHINE_INDEX: ${{ matrix.node-version }}
if: ${{ needs.changes.outputs.cms == 'true' }}
- uses: actions/upload-artifact@v3
if: ${{ always() && needs.changes.outputs.cms == 'true' }}
if: ${{ always() }}
with:
name: cypress-results-${{ matrix.node-version }}
path: |
Expand Down
Loading