-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (98 loc) · 3.21 KB
/
CI.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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Run tests
on:
workflow_dispatch:
push:
schedule:
- cron: "0 2 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
cancel-in-progress: true
jobs:
job1:
name: "Prepare Tests"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: |
echo "matrix={\"node\":[$(python getter.py)]}" >> $GITHUB_OUTPUT
- name: "Set Up Julia"
uses: julia-actions/setup-julia@v2
with:
version: "1.10"
- uses: julia-actions/cache@v2
with:
cache-name: julia-cache;workflow=${{ github.workflow }};ref=${{ github.run_id }}
include-matrix: false
- name: "Install julia pre-requisites"
run: |
julia -e '
using Pkg
Pkg.add("Oscar")
Pkg.add("BenchmarkTools")
Pkg.add("GraphRecipes")
Pkg.add("Graphs")
Pkg.add("Interact")
Pkg.add("Plots")'
job2:
needs:
- job1
name: "Run tests"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJSON(needs.job1.outputs.matrix)}}
timeout-minutes: 60
steps:
- name: "Set Up Julia"
uses: julia-actions/setup-julia@v2
with:
version: "1.10"
- uses: julia-actions/cache@v2
with:
cache-name: julia-cache;workflow=${{ github.workflow }};ref=${{ github.run_id }}
include-matrix: false
- uses: actions/checkout@v4
- name: "Install Jupyter"
run: |
if (( $(echo "$(pip --version | awk '{print $2}' | cut -d'.' -f 1,2) >= 23.1" |bc -l) )); then
FLAG='--break-system-packages'
else
FLAG=''
fi
pip3 install $FLAG notebook jupytext
- name: "Install julia pre-requisites"
run: |
julia -e '
using Pkg
Pkg.add("Oscar")
Pkg.add("BenchmarkTools")
Pkg.add("GraphRecipes")
Pkg.add("Graphs")
Pkg.add("Interact")
Pkg.add("IJulia")
Pkg.add("Plots")'
- run: mkdir -pv notebooks
- name: Use default julia environment
run: |
cat ~/.local/share/jupyter/kernels/julia-1.10/kernel.json | sed 's/^.*project=.*$//' > ~/.local/share/jupyter/kernels/julia-1.10/kernel.json.new
mv -v ~/.local/share/jupyter/kernels/julia-1.10/kernel.json.new ~/.local/share/jupyter/kernels/julia-1.10/kernel.json
- run: python3 tester.py ${{ matrix.node }}
- name: Upload new notebook
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.node }}
path: notebooks/*.ipynb
retention-days: 7
- name: Notify Slack Action
if: always()
uses: ravsamhq/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
message_format: "{emoji} *${{matrix.node}}* {status_message} in <{run_url}>"
notify_when: "failure,cancelled,skipped"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}