-
Notifications
You must be signed in to change notification settings - Fork 32
84 lines (67 loc) · 2.19 KB
/
ci-examples.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
name: CI-examples
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# Trigger the workflow on push to master or pull request
# to be merged in master
push:
branches:
- master
pull_request:
branches:
- master
jobs:
list-examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout JUDI
uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(ls examples/scripts/*.jl examples/machine-learning/*.jl | xargs -n 1 | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
shell: bash
run-examples:
runs-on: ubuntu-latest
needs: list-examples
name: ${{ matrix.example }}
env:
DEVITO_ARCH: gcc-12
DEVITO_LANGUAGE: "openmp"
DEVITO_LOGGING: "ERROR"
OMP_NUM_THREADS: 1
JULIA_NUM_THREADS: 1
NITER: 2
strategy:
fail-fast: false
matrix:
example: ${{ fromJson(needs.list-examples.outputs.matrix) }}
version: ['1']
steps:
- name: Checkout JUDI
uses: actions/checkout@v4
- name: Setup julia
uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: x64
- uses: julia-actions/cache@v2
- name: Set julia python
run: |
python3 -m pip install -U pip
python3 -m pip install "matplotlib<3.9" seiscm colorcet
echo "JULIA_PYTHONCALL_EXE=$(which python3)" >> $GITHUB_ENV
echo "JULIA_CONDAPKG_BACKEND=\"Null\"" >> $GITHUB_ENV
echo "PYTHON=$(which python3)" >> $GITHUB_ENV
echo "PYCALL_JL_RUNTIME_PYTHON=$(which python3)" >> $GITHUB_ENV
- name: Build JUDI
uses: julia-actions/julia-buildpkg@latest
- name: Install packages
run: |
julia -e 'using Pkg;Pkg.add(["SlimPlotting", "PyPlot", "NLopt", "Flux", "JOLI", "Zygote", "IterativeSolvers", "SlimOptim", "HDF5", "SegyIO", "SetIntersectionProjection"])'
julia -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()))'
- name: Run examples
run: julia -p 2 -t 1 ${{ matrix.example }}