Skip to content

Commit e2e4e0b

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

File tree

1 file changed

+48
-38
lines changed

1 file changed

+48
-38
lines changed

.github/workflows/CI.yml

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -22,64 +22,74 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
version:
25-
- '1.9'
26-
python: [3.9]
27-
os:
28-
- ubuntu-latest
25+
- '1.10'
26+
python:
27+
- '3.10'
28+
os: [ubuntu-latest, macos-latest]
2929
arch:
3030
- x64
3131
steps:
32-
- uses: actions/checkout@v2
32+
# Cancel ongoing CI test runs if pushing to branch again before the previous tests
33+
# have finished
34+
- name: Cancel ongoing test runs for previous commits
35+
uses: styfle/cancel-workflow-action@0.12.1
36+
with:
37+
access_token: ${{ github.token }}
38+
# Do tests
39+
- uses: actions/checkout@v4
3340
- name: Set up Python 🐍 ${{ matrix.python }}
3441
uses: actions/setup-python@v2
3542
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
43+
python-version: ${{ matrix.python }}
44+
- name: Install certifi and set SSL_CERT_FILE
45+
run: |
46+
pip install --upgrade certifi
47+
echo "SSL_CERT_FILE=$(python -c 'import certifi; print(certifi.where())')" >> $GITHUB_ENV
5448
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
49+
- uses: julia-actions/setup-julia@latest
6250
with:
6351
version: ${{ matrix.version }}
6452
arch: ${{ matrix.arch }}
6553
- name: Check Julia SSL certifications 🔎🔐
6654
run: julia -e 'using NetworkOptions; println(NetworkOptions.bundled_ca_roots()); println(NetworkOptions.ca_roots())'
6755
shell: bash -el {0}
68-
- uses: julia-actions/cache@v1
56+
- name: Install dependencies on Ubuntu
57+
if: matrix.os == 'ubuntu-latest'
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -y libxml2
61+
echo "/usr/lib/x86_64-linux-gnu" | sudo tee -a /etc/ld.so.conf.d/libxml2.conf
62+
sudo ldconfig
63+
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
64+
shell: bash -el {0}
65+
- name: Install dependencies on macOS
66+
if: matrix.os == 'macos-latest'
67+
run: |
68+
brew install libxml2
69+
export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"
70+
shell: bash -el {0}
71+
- uses: julia-actions/cache@v2
6972
with:
7073
cache-registries: "true"
7174
cache-compiled: "true"
75+
- uses: actions/cache@v4
76+
env:
77+
cache-name: cache-artifacts
78+
with:
79+
path: ~/.julia/artifacts
80+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
81+
restore-keys: |
82+
${{ runner.os }}-test-${{ env.cache-name }}-
83+
${{ runner.os }}-test-
84+
${{ runner.os }}-
7285
- uses: julia-actions/julia-buildpkg@v1
7386
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
87+
JULIA_SSL_CA_ROOTS_PATH: ""
88+
- uses: julia-actions/julia-runtest@latest
7889
env:
79-
PYTHON : /home/runner/micromamba/envs/oggm_env/bin/python
80-
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
90+
JULIA_SSL_CA_ROOTS_PATH: ""
8191
- uses: julia-actions/julia-processcoverage@v1
82-
- uses: codecov/codecov-action@v3
92+
- uses: codecov/codecov-action@v4
8393
with:
8494
token: ${{secrets.CODECOV_TOKEN}}
8595
files: lcov.info

0 commit comments

Comments
 (0)