-
Notifications
You must be signed in to change notification settings - Fork 28
41 lines (36 loc) · 1.4 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
on:
schedule:
- cron: '0 0 * * *' # Runs every day at midnight
jobs:
check-for-new-commits:
runs-on: ubuntu-latest
outputs:
NEW_COMMITS: ${{ steps.check-commits.outputs.NEW_COMMITS }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get latest commit SHA
id: get-latest-commit-sha
run: echo "LATEST_COMMIT_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Check last run
id: check-commits
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
latest_run_commit_sha=$(curl --silent --header "Authorization: token $GITHUB_TOKEN" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/nightly.yml/runs?status=success&&per_page=1" \
| jq -r '.workflow_runs | first | .head_sha')
echo "Latest completed run was on commit: $latest_run_commit_sha"
echo "Current commit is: $LATEST_COMMIT_SHA"
if [ "$latest_run_commit_sha" != "$LATEST_COMMIT_SHA" ]; then
echo "NEW_COMMITS=true" >> "$GITHUB_OUTPUT"
else
echo "NEW_COMMITS=false" >> "$GITHUB_OUTPUT"
fi
build-wheel:
needs: check-for-new-commits
if : ${{ needs.check-for-new-commits.outputs.NEW_COMMITS == 'true' }}
uses: kaizhang/SnapATAC2/.github/workflows/wheels.yml@main
with:
wheel: 'true'