-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (72 loc) · 2.26 KB
/
cron.yaml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
on:
# TODO: change to cron-based schedule one this is working
push:
branches:
- main
jobs:
test:
name: "Test dask and distributed"
# TODO: change to appropriate image
runs-on: ubuntu-latest
steps:
- name: Checkout ourselves
uses: actions/checkout@v4
with:
path: utils
- name: Checkout dask
uses: actions/checkout@v4
with:
repository: dask/dask
path: dask
- name: Checkout distributed
uses: actions/checkout@v4
with:
repository: dask/distributed
path: distributed
- name: Run
run: |
(cd dask; git rev-parse HEAD;
cd ../distributed; git rev-parse HEAD) | tee commit-hashes.txt
- name: Upload commit hashes
uses: actions/upload-artifact@v4
with:
name: commit-hashes.txt
path: commit-hashes.txt
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Get last artifact URL from last run
id: get_last_id
run: |
pip install requests
VAL=$(python utils/get.py)
echo "${VAL}"
echo "${VAL}" >> $GITHUB_OUTPUT
- name: Download artifact from last run if exists
if: ${{ fromJSON(steps.get_last_id.outputs.INFO).exists }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: commit-hashes.txt
path: previous-run
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ fromJSON(steps.get_last_id.outputs.INFO).id }}
- name: Check if test run is needed
id: check_run_needed
run: |
ls -l previous-run/
if [ ! -f previous-run/commit-hashes.txt ]; then
echo "No previous run hashes, need to re-run"
echo 'INFO={"rerun": true}' >> $GITHUB_OUTPUT
elif cmp -s commit-hashes.txt previous-run/commit-hashes.txt; then
echo "Previous run hash same as this one, no need to re-run"
echo 'INFO={"rerun": false}' >> $GITHUB_OUTPUT
else
echo "Previous run hash different, need to re-run"
echo 'INFO={"rerun": true}' >> $GITHUB_OUTPUT
fi
- name: Run tests
if: ${{ fromJSON(steps.check_run_needed.outputs.INFO).rerun }}
run: |
echo Running tests