Skip to content

Commit

Permalink
chore: update CI workflow to handle distributed execution
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Aug 16, 2024
1 parent ddf964a commit a0974ef
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# --require-explicit-completion because Nx agents might not receive tasks for more than 30 seconds when preparing the e2e test environment
# @see https://nx.dev/ci/troubleshooting/ci-execution-failed#the-nx-cloud-heartbeat-process-failed-to-report-its-status-in-time
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-small-js" --require-explicit-completion --with-env-vars="DOTENV_PRIVATE_KEY_CI,POSTGRES_DB,POSTGRES_URL"
if: ${{ env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'true' }}
if: env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'true'

- uses: actions/setup-node@v4
with:
Expand All @@ -57,7 +57,7 @@ jobs:
- run: npx nx format:check

- run: npx nx affected -t lint test build
if: ${{ !env.ACT }}
if: env.ACT != 'true'

- run: |
npm run ory:generate:kratos -- -e .env.ci
Expand All @@ -80,22 +80,22 @@ jobs:
npx nx-cloud record -- docker compose -p cat-fostering logs keto -n 500
npx nx-cloud record -- docker compose -p cat-fostering logs kratos -n 500
- name: Run e2e tests
run: npx nx affected -t e2e --no-agents
# if: ${{ env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'false' }}

- if: failure()
run: |
npx nx-cloud record -- docker compose -p cat-fostering logs api -n 200
npx nx-cloud record -- docker compose -p cat-fostering logs kratos -n 200
# to enable DTE for e2e tests splitting, use the following command instead and set stop-agents-after="e2e-ci"
# - name: Run distributed e2e tests
# run: |
# npm run pg:create:connection -- -e .env.ci
# docker compose -p cat-fostering restart api
# npx nx affected -t e2e-ci
# if: ${{ env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'true' }}
# if: env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'true'

- run: npx nx-cloud complete-ci-run
if: always() && ${{ env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'true' }}
if: always() && env.NX_CLOUD_DISTRIBUTED_EXECUTION != 'false'

- name: Run e2e tests
run: npx nx affected -t e2e --no-agents
# if: ${{ env.NX_CLOUD_DISTRIBUTED_EXECUTION == 'false' }}

- if: failure()
run: |
npx nx-cloud record -- docker compose -p cat-fostering logs api -n 200
npx nx-cloud record -- docker compose -p cat-fostering logs kratos -n 200

0 comments on commit a0974ef

Please sign in to comment.