Skip to content

Commit

Permalink
chore: run e2e only if affected
Browse files Browse the repository at this point in the history
  • Loading branch information
AlitaBernachot committed Feb 25, 2025
1 parent e21f087 commit 6064402
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,32 @@ jobs:
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3

- run: npm ci

- name: Compute affected apps
run: |
echo "AFFECTED_APPS=$(npx nx show projects --affected --type=app | awk 'BEGIN {RS = ", "; ORS = ", "} \
{ print "`"$1"`" }')" >> $GITHUB_ENV
- name: Create pipeline docker image
working-directory: tools
run: docker build . -f pipelines/Dockerfile -t geonetwork/geonetwork-ui-tools-pipelines:latest

- name: Start up backend support services
if: contains(env.AFFECTED_APPS, matrix.app)
env:
GEONETWORK_VERSION: ${{ matrix.gn_version }}
working-directory: support-services
run: docker compose up --quiet-pull init

- run: npm ci

- name: Run e2e tests for ${{ matrix.app }}
- name: Run e2e tests for ${{ matrix.app }} (if affected)
if: contains(env.AFFECTED_APPS, matrix.app)
env:
APP: ${{ matrix.app }}
run: npx nx e2e "$APP-e2e"

- uses: actions/upload-artifact@v4
if: always()
if: always() && contains(env.AFFECTED_APPS, matrix.app)
id: upload-screenshots
with:
name: cypress-screenshots-app-${{ matrix.app }}-gn-${{ matrix.gn_version }}
Expand All @@ -191,7 +198,7 @@ jobs:
apps/metadata-editor-e2e/cypress/screenshots/**/*
- uses: thollander/actions-comment-pull-request@v2
if: always() && github.event_name == 'pull_request' && steps.upload-screenshots.outputs.artifact-url
if: always() && contains(env.AFFECTED_APPS, matrix.app) && github.event_name == 'pull_request' && steps.upload-screenshots.outputs.artifact-url
with:
message: '📷 Screenshots are [here](${{ steps.upload-screenshots.outputs.artifact-url }})!'
comment_tag: screenshots-url
Expand Down

0 comments on commit 6064402

Please sign in to comment.