Prevent nightly master build when no commits in last 24h
This commit is contained in:
20
.github/workflows/nightly.yml
vendored
20
.github/workflows/nightly.yml
vendored
@@ -8,9 +8,24 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
check-commits:
|
||||||
|
name: Count commits in last 24h
|
||||||
|
if: github.repository == 'technyon/nuki_hub'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
- name: Get new commits
|
||||||
|
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
|
||||||
|
- name: Check if commits larger than 1
|
||||||
|
if: ${{ env.NEW_COMMIT_COUNT > 1 }}
|
||||||
|
run: echo
|
||||||
build:
|
build:
|
||||||
name: Build ${{ matrix.board }} (${{ matrix.build }})
|
name: Build ${{ matrix.board }} (${{ matrix.build }})
|
||||||
if: github.repository == 'technyon/nuki_hub'
|
if: github.repository == 'technyon/nuki_hub'
|
||||||
|
needs: check-commits
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -34,12 +49,8 @@ jobs:
|
|||||||
echo "VARIANT=${VARIANT}" | tee -a ${GITHUB_ENV}
|
echo "VARIANT=${VARIANT}" | tee -a ${GITHUB_ENV}
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Get new commits
|
|
||||||
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
if: ${{ env.NEW_COMMIT_COUNT > 1 }}
|
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/pip
|
~/.cache/pip
|
||||||
@@ -98,6 +109,7 @@ jobs:
|
|||||||
path: ${{ matrix.build }}/${{ env.VARIANT }}
|
path: ${{ matrix.build }}/${{ env.VARIANT }}
|
||||||
ota-nightly:
|
ota-nightly:
|
||||||
name: Create nightly from latest master
|
name: Create nightly from latest master
|
||||||
|
if: github.repository == 'technyon/nuki_hub'
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Reference in New Issue
Block a user