Skip to content

Commit bec4b0e

Browse files
🔄 synced local '.github/workflows/CI.yml' with remote '.github/workflows/CI.yml'
1 parent 1dbbcc1 commit bec4b0e

File tree

1 file changed

+58
-47
lines changed

1 file changed

+58
-47
lines changed

.github/workflows/CI.yml

Lines changed: 58 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,96 @@
11
name: Run Tests
22
on:
3-
pull_request:
3+
pull_request:
44
branches:
55
- main
6-
push:
6+
push:
77
branches: []
88
tags: '*'
99
concurrency:
10-
# Skip intermediate builds: always.
11-
# Cancel intermediate builds: only if it is a pull request build.
1210
group: ${{ github.workflow }}-${{ github.ref }}
1311
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1412
jobs:
1513
test:
1614
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1715
runs-on: ${{ matrix.os }}
1816
defaults:
19-
run:
20-
shell: bash -el {0}
17+
run:
18+
shell: bash -el {0}
2119
strategy:
2220
fail-fast: false
2321
matrix:
2422
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]
2927
arch:
3028
- x64
3129
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
3335
- name: Set up Python 🐍 ${{ matrix.python }}
3436
uses: actions/setup-python@v2
3537
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
6244
with:
6345
version: ${{ matrix.version }}
6446
arch: ${{ matrix.arch }}
6547
- name: Check Julia SSL certifications 🔎🔐
6648
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
6973
with:
7074
cache-registries: "true"
7175
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 }}-
7286
- uses: julia-actions/julia-buildpkg@v1
7387
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
7890
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: ""
8192
- uses: julia-actions/julia-processcoverage@v1
82-
- uses: codecov/codecov-action@v3
93+
- uses: codecov/codecov-action@v4
8394
with:
8495
token: ${{secrets.CODECOV_TOKEN}}
85-
files: lcov.info
96+
files: lcov.info

0 commit comments

Comments
 (0)