Skip to content

Commit

Permalink
Added Github cron job.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charankumar H authored and Charankumar H committed Nov 5, 2024
1 parent 4860118 commit d04d6b1
Showing 1 changed file with 3 additions and 35 deletions.
38 changes: 3 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- master
- issue-*
- fb_*
schedule:
- cron: 0 19 * * *

jobs:
build_and_test:
Expand Down Expand Up @@ -273,38 +275,4 @@ jobs:
name: target

- name: Run E2E Tests (MS Edge)
run: mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_E2E -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3

cleanup:
name: Cleanup Cache
runs-on: ubuntu-latest
needs:
- build_and_test
- smoke_job_chrome_headless
- smoke_job_msedge_headless
- smoke_job_firefox_headless
- regression_job_chrome_headless
- regression_job_firefox_headless
- regression_job_msedge_headless
- E2E_job_chrome_headless
- E2E_job_firefox_headless
- E2E_job_msedge_headless

if: ${{ github.event.pull_request.merged == false && github.event.action == 'closed' }}

steps:
- name: Cleanup
run: |
echo "Fetching list of cache keys"
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ vars.TOKEN }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
run: mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_E2E -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3

0 comments on commit d04d6b1

Please sign in to comment.