Skip to content

Commit fed5a29

Browse files
committed
test: Poetry on MacOS
1 parent 49b9dfc commit fed5a29

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/test.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,16 @@ jobs:
5757
working-directory: flooding/Sentinel2_Water_Extraction
5858

5959
test-poetry:
60-
name: Test using Poetry on Python ${{ matrix.python }}
61-
runs-on: ubuntu-22.04
60+
name:
61+
Test on ${{ matrix.runner }}, using Poetry with Python ${{ matrix.python
62+
}}
63+
runs-on: ${{ matrix.runner }}
6264
strategy:
6365
fail-fast: false
6466
matrix:
67+
runner:
68+
- macos-12
69+
- ubuntu-22.04
6570
python:
6671
- "3.8"
6772
- "3.9"
@@ -76,22 +81,32 @@ jobs:
7681
with:
7782
python-version: ${{ matrix.python }}
7883

84+
- name: Get pip cache directory
85+
id: pip-cache
86+
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
87+
7988
- name: Cache pip
8089
uses: actions/cache@v3.2.3
8190
with:
82-
path: ~/.cache/pip
91+
path: ${{ steps.pip-cache.outputs.dir }}
8392
key:
8493
${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ matrix.python
8594
}}-${{
8695
hashFiles('./flooding/Sentinel2_Water_Extraction/poetry.lock') }}
8796
restore-keys: |
8897
${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ matrix.python }}-
8998
90-
- name: Update package registry
99+
- name: Update package registry on Linux
91100
run: sudo apt-get update
101+
if: startsWith(runner.os, 'Linux')
92102

93-
- name: Install GDAL
103+
- name: Install GDAL on Linux
94104
run: sudo apt-get --assume-yes install libgdal-dev
105+
if: startsWith(runner.os, 'Linux')
106+
107+
- name: Install GDAL on MacOS
108+
run: brew install gdal
109+
if: startsWith(runner.os, 'macOS')
95110

96111
- name: Upgrade pip
97112
run: pip install --upgrade pip

0 commit comments

Comments
 (0)