Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit b500dfb

Browse files
committed
github: only run nightly if there have been commits
1 parent cf9e102 commit b500dfb

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/nightly-linux.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,30 @@ on:
55
- cron: '0 0 * * *'
66

77
jobs:
8+
9+
check_changes:
10+
runs-on: ubuntu-latest
11+
name: Check latest commit
12+
outputs:
13+
should_run: ${{ steps.should_run.outputs.should_run }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
submodules: true
18+
19+
- name: Print latest commit
20+
run: echo ${{ github.sha }}
21+
22+
- id: should_run
23+
continue-on-error: true
24+
name: check latest commit is less than a day
25+
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
26+
827
build:
28+
needs: [check_changes]
29+
if: ${{ needs.check_changes.outputs.should_run != 'false' }}
930
name: ${{matrix.family}}-${{matrix.compiler}}-${{matrix.buildtype}}
10-
runs-on: ${{matrix.os}}-latest
31+
runs-on: ubuntu-latest
1132
environment: CI
1233
strategy:
1334
fail-fast: false
@@ -17,11 +38,9 @@ jobs:
1738
include:
1839
- name: linux-gcc
1940
family: linux
20-
os: ubuntu
2141
compiler: gcc
2242
- name: linux-clang
2343
family: linux
24-
os: ubuntu
2544
compiler: clang
2645
steps:
2746
- uses: actions/checkout@v3

0 commit comments

Comments
 (0)