Skip to content

Commit

Permalink
Refactor cron daily job to reuse pr workflow (#4062)
Browse files Browse the repository at this point in the history
* Refactor cron daily job to reuse pr workflow

* CR  fix
  • Loading branch information
MichalKinas authored Aug 28, 2024
1 parent d2ce87c commit f4dd41b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 39 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/daily-ci-cron.yml

This file was deleted.

15 changes: 5 additions & 10 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ on:
pull_request:
types: [opened, synchronize, reopened]
branches: [master, develop]
workflow_call:
inputs:
cron-run:
description: 'Disables jobs which should not run during cron execution'
required: false
type: string
default: 'false'
schedule:
- cron: '0 12 * * 1-5' #At 12:00 on every day-of-week from Monday through Friday.

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -33,7 +28,7 @@ env:

jobs:
lint:
if: ${{ inputs.cron-run == 'false' || inputs.cron-run == '' }}
if: ${{ github.event_name == 'pull_request' }}
name: 'lint'
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -94,11 +89,11 @@ jobs:
- run: npm ci

- name: Test
if: ${{ inputs.cron-run == 'false' || inputs.cron-run == '' }}
if: ${{ github.event_name == 'pull_request' }}
run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop

- name: Test all
if: ${{ inputs.cron-run == 'true' }}
if: ${{ github.event_name != 'pull_request' }}
run: npx nx run-many --target=test --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop

e2es-playwright:
Expand Down

0 comments on commit f4dd41b

Please sign in to comment.