-
Notifications
You must be signed in to change notification settings - Fork 97
41 lines (36 loc) · 1.18 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Nightly
run-name: Nightly build
on:
schedule:
- cron: "0 0 * * *"
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Delete previous cancelled runs
uses: Mattraks/delete-workflow-runs@v2
with:
retain_days: 0
keep_minimum_runs: 0
delete_workflow_pattern: ${{ github.workflow }}
delete_run_by_conclusion_pattern: cancelled
- name: Check for new commits
id: check-new-commits
uses: adriangl/check-new-commits-action@v1
with:
seconds: 86400 # One day in seconds
branch: 'master'
- name: Cancel action if no new commits
if: ${{ steps.check-new-commits.outputs.has-new-commits != 'true' }}
uses: andymckay/[email protected]
- name: Wait for cancellation
if: ${{ steps.check-new-commits.outputs.has-new-commits != 'true' }}
shell: bash
run: while true; do echo "Waiting for job to be cancelled"; sleep 5; done
build_for_nightly:
needs: prepare
uses: ./.github/workflows/build.yml
with:
build-configs: '"Debug", "Release"'