Skip to content

Commit 2ff40be

Browse files
committed
Add artifacts creation to GitHub actions again
1 parent 1fc3b56 commit 2ff40be

File tree

2 files changed

+38
-66
lines changed

2 files changed

+38
-66
lines changed

.github/workflows/ci.yaml

Lines changed: 35 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ env:
1717
PYTHON_VERSION: "3.11"
1818

1919
jobs:
20-
setup:
21-
name: Setup tests
20+
test:
21+
name: Run tests
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: write
@@ -29,17 +29,17 @@ jobs:
2929
with:
3030
persist-credentials: false
3131

32-
- name: Restore testing cache 📥
33-
uses: actions/cache@v4
34-
with:
35-
path: |
36-
testing/datasets
37-
testing/extractions
38-
testing/protocol
39-
testing/share
40-
key: testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/*.py') }}
41-
restore-keys: |
42-
testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
32+
# - name: Restore testing cache 📥
33+
# uses: actions/cache@v4
34+
# with:
35+
# path: |
36+
# testing/datasets
37+
# testing/extractions
38+
# testing/protocol
39+
# testing/share
40+
# key: testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('isimip_utils/tests/constants.py') }}
41+
# restore-keys: |
42+
# testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
4343

4444
- name: Install cdo 🌍
4545
run: |
@@ -50,63 +50,35 @@ jobs:
5050
uses: actions/setup-python@v6
5151
with:
5252
python-version: ${{ env.PYTHON_VERSION }}
53+
cache: 'pip'
5354

5455
- name: Install package 📦
55-
run: pip install -e .[all]
56+
run: |
57+
pip install --upgrade pip
58+
pip install -e .[all]
5659
5760
- name: Run setup scripts 🔧
5861
run: |
5962
python testing/download.py
6063
python testing/setup.py
6164
62-
- name: Save testing cache 📤
63-
if: always()
64-
uses: actions/cache/save@v4
65-
with:
66-
path: |
67-
testing/datasets
68-
testing/extractions
69-
testing/protocol
70-
testing/share
71-
key: testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/*.py') }}
72-
73-
test:
74-
name: Run tests
75-
needs: setup
76-
runs-on: ubuntu-latest
77-
permissions:
78-
contents: write
79-
80-
steps:
81-
- name: Check out repository 💾
82-
uses: actions/checkout@v5
83-
with:
84-
persist-credentials: false
85-
86-
- name: Restore testing cache 📥
87-
uses: actions/cache@v4
88-
with:
89-
path: |
90-
testing/datasets
91-
testing/extractions
92-
testing/protocol
93-
testing/share
94-
key: testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/*.py') }}
95-
restore-keys: |
96-
testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
97-
98-
- name: Install cdo 🌍
99-
run: |
100-
sudo apt-get update
101-
sudo apt-get install -y cdo netcdf-bin --no-install-recommends
102-
103-
- name: Set up Python 🐍
104-
uses: actions/setup-python@v6
105-
with:
106-
python-version: ${{ env.PYTHON_VERSION }}
107-
108-
- name: Install package 📦
109-
run: pip install -e .[all]
65+
# - name: Save testing cache 📤
66+
# if: always()
67+
# uses: actions/cache/save@v4
68+
# with:
69+
# path: |
70+
# testing/datasets
71+
# testing/extractions
72+
# testing/protocol
73+
# testing/share
74+
# key: testing-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('isimip_utils/tests/constants.py') }}
11075

11176
- name: Run pytest 🧪
112-
run: pytest --cov=isimip_utils --cov-fail-under=90 --cov-report=term-missing
77+
run: pytest --cov=isimip_utils --cov-fail-under=90 --cov-report=term-missing isimip_utils/tests/test_fetch.py
78+
79+
# - name: Upload testing directory 📤
80+
# uses: actions/upload-artifact@v5
81+
# with:
82+
# name: testing
83+
# path: |
84+
# testing/protocol

testing/download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
def main():
6-
download_datasets()
76
download_protocol()
7+
download_datasets()
88

99

1010
def download_datasets():
@@ -16,7 +16,7 @@ def download_datasets():
1616

1717
url = f"https://files.isimip.org/{path}"
1818

19-
helper.call(f'wget -c {url} -O {file_path}')
19+
helper.call(f'curl -C - -L -f -o {file_path} {url}')
2020

2121

2222
def download_protocol():
@@ -28,7 +28,7 @@ def download_protocol():
2828

2929
url = f"https://protocol.isimip.org/{path}"
3030

31-
helper.call(f'wget -c {url} -O {file_path}')
31+
helper.call(f'curl -C - -L -f -o {file_path} {url}')
3232

3333

3434
if __name__ == "__main__":

0 commit comments

Comments
 (0)