1
1
name : Run Tests
2
2
on :
3
- pull_request :
3
+ pull_request :
4
4
branches :
5
5
- main
6
- push :
6
+ push :
7
7
branches : []
8
8
tags : ' *'
9
9
concurrency :
10
- # Skip intermediate builds: always.
11
- # Cancel intermediate builds: only if it is a pull request build.
12
10
group : ${{ github.workflow }}-${{ github.ref }}
13
11
cancel-in-progress : ${{ startsWith(github.ref, 'refs/pull/') }}
14
12
jobs :
15
13
test :
16
14
name : Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
17
15
runs-on : ${{ matrix.os }}
18
16
defaults :
19
- run :
20
- shell : bash -el {0}
17
+ run :
18
+ shell : bash -el {0}
21
19
strategy :
22
20
fail-fast : false
23
21
matrix :
24
22
version :
25
- - ' 1.9 '
26
- python : [3.9]
27
- os :
28
- - ubuntu -latest
23
+ - ' 1.10 '
24
+ python :
25
+ - ' 3.10 '
26
+ os : [ubuntu-latest, macos -latest]
29
27
arch :
30
28
- x64
31
29
steps :
32
- - uses : actions/checkout@v2
30
+ - name : Cancel ongoing test runs for previous commits
31
+ uses : styfle/cancel-workflow-action@0.12.1
32
+ with :
33
+ access_token : ${{ github.token }}
34
+ - uses : actions/checkout@v4
33
35
- name : Set up Python 🐍 ${{ matrix.python }}
34
36
uses : actions/setup-python@v2
35
37
with :
36
- python-version : ${{ matrix.python }}
37
- - name : Create environment with micromamba 🐍🖤
38
- uses : mamba-org/setup-micromamba@v1
39
- with :
40
- micromamba-version : ' 1.5.6-0'
41
- environment-file : ./environment.yml
42
- environment-name : oggm_env # it is recommendable to add both name and yml file.
43
- init-shell : bash
44
- cache-environment : true
45
- # condarc-file: ./condarc.yml # If necessary, we can include .condarc to configure environment
46
- - name : Test creation of environment with micromamba 🔧🐍🖤
47
- run : |
48
- which python
49
- conda env export
50
- shell : bash -el {0}
51
- - name : Update certifi
52
- run : |
53
- pip install --upgrade certifi
54
- shell : bash -el {0}
55
- # - name: Test OGGM installation 🔧🌎
56
- # run: pytest.oggm
57
- # shell: bash -el {0}
58
- - name : Set ENV Variables for PyCall.jl 🐍 📞
59
- run : export PYTHON=/home/runner/micromamba/envs/oggm_env/bin/python
60
- shell : bash -el {0}
61
- - uses : julia-actions/setup-julia@v1
38
+ python-version : ${{ matrix.python }}
39
+ - name : Install certifi and set SSL_CERT_FILE
40
+ run : |
41
+ pip install --upgrade certifi
42
+ echo "SSL_CERT_FILE=$(python -c 'import certifi; print(certifi.where())')" >> $GITHUB_ENV
43
+ - uses : julia-actions/setup-julia@latest
62
44
with :
63
45
version : ${{ matrix.version }}
64
46
arch : ${{ matrix.arch }}
65
47
- name : Check Julia SSL certifications 🔎🔐
66
48
run : julia -e 'using NetworkOptions; println(NetworkOptions.bundled_ca_roots()); println(NetworkOptions.ca_roots())'
67
- shell : bash -el {0}
68
- - uses : julia-actions/cache@v1
49
+ - name : Install dependencies on Ubuntu
50
+ if : matrix.os == 'ubuntu-latest'
51
+ run : |
52
+ sudo apt-get update
53
+ sudo apt-get install -y libxml2-dev libspatialite-dev
54
+ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
55
+ # Print installed versions for debugging
56
+ dpkg -l | grep libxml2
57
+ dpkg -l | grep libspatialite
58
+ - name : Install dependencies on macOS
59
+ if : matrix.os == 'macos-latest'
60
+ run : |
61
+ brew install libxml2 libspatialite
62
+ export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
63
+ - name : Debug library information
64
+ if : matrix.os == 'ubuntu-latest'
65
+ run : |
66
+ ldconfig -p | grep libxml
67
+ ldconfig -p | grep libspatialite
68
+ ldd $(find /usr/lib -name "libspatialite.so*" | head -n 1) || true
69
+ ldd $(find /home/runner/work/Sleipnir.jl/Sleipnir.jl/.CondaPkg/env/lib -name "libspatialite.so*" | head -n 1) || true
70
+ pkg-config --modversion libxml-2.0
71
+ pkg-config --modversion spatialite
72
+ - uses : julia-actions/cache@v2
69
73
with :
70
74
cache-registries : " true"
71
75
cache-compiled : " true"
76
+ - uses : actions/cache@v4
77
+ env :
78
+ cache-name : cache-artifacts
79
+ with :
80
+ path : ~/.julia/artifacts
81
+ key : ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
82
+ restore-keys : |
83
+ ${{ runner.os }}-test-${{ env.cache-name }}-
84
+ ${{ runner.os }}-test-
85
+ ${{ runner.os }}-
72
86
- uses : julia-actions/julia-buildpkg@v1
73
87
env :
74
- PYTHON : /home/runner/micromamba/envs/oggm_env/bin/python
75
- # The SSL certificate path can be readed from the action "Check Julia SSL certifications"
76
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
77
- - uses : julia-actions/julia-runtest@v1
88
+ JULIA_SSL_CA_ROOTS_PATH : " "
89
+ - uses : julia-actions/julia-runtest@latest
78
90
env :
79
- PYTHON : /home/runner/micromamba/envs/oggm_env/bin/python
80
- SSL_CERT_FILE : /etc/ssl/certs/ca-certificates.crt
91
+ JULIA_SSL_CA_ROOTS_PATH : " "
81
92
- uses : julia-actions/julia-processcoverage@v1
82
- - uses : codecov/codecov-action@v3
93
+ - uses : codecov/codecov-action@v4
83
94
with :
84
95
token : ${{secrets.CODECOV_TOKEN}}
85
- files : lcov.info
96
+ files : lcov.info
0 commit comments