Skip to content

Commit

Permalink
add prepare block for scheduling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lia-viam committed Sep 24, 2024
1 parent be04812 commit 0b36cb5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
name: Test conan packages

on:
# Run weekdays at 11:15pm UTC, and specify below to only run if there's been new commits
schedule:
- cron: "15 11 * * 1-5"
workflow_dispatch:

jobs:
prepare:
# if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Get new commit count
id: new_commit_count
shell: bash
run: echo "commit_count=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT

- name: Cancelling scheduled build with no new commits
uses: andymckay/[email protected]
if: |
steps.new_commit_count.outputs.commit_count == '0' &&
github.event_name == 'schedule'
build_macos:
# if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: macos-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -38,6 +60,7 @@ jobs:
build_linux_ubuntu_jammy:
# if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: ${{ matrix.runs_on }}
container:
image: ${{ matrix.image }}
Expand Down Expand Up @@ -95,6 +118,7 @@ jobs:
build_linux_debian:
# if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: ${{ matrix.runs_on }}
container:
image: ${{ matrix.image }}
Expand Down

0 comments on commit 0b36cb5

Please sign in to comment.