Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert test with latest GDAL into a reusable workflow #2967

Merged
merged 6 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/test_gdal_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
on:
workflow_call:
inputs:
gdal_ref:
required: true
type: string
rasterio_ref:
required: true
type: string

jobs:
test_rasterio:
name: Test rasterio ${{ inputs.rasterio_ref }} in PROJ container with GDAL ${{ inputs.gdal_ref }}
runs-on: ubuntu-latest
container: ghcr.io/osgeo/proj:9.2.0
env:
GDAL_DIR: ${{ github.workspace }}/gdal_install
GDAL_DATA: ${{ github.workspace }}/gdal_install/share/gdal
LD_LIBRARY_PATH: "${{ github.workspace }}/gdal_install/lib/:${LD_LIBRARY_PATH}"
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.rasterio_ref }}
- name: Update
run: |
apt-get update
apt-get -y install software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update

- name: Set up Python
run: |
apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
python3.10-venv \
python3-pip \
g++

- name: Install GDAL
shell: bash
run: |
apt-get update
apt-get install -qq \
libcurl4-openssl-dev \
libtiff-dev \
libgeos-dev \
libjpeg-dev \
libnetcdf-dev \
libhdf4-alt-dev \
libhdf5-serial-dev \
libssl-dev \
libsqlite3-dev \
libexpat-dev \
libxerces-c-dev \
libpng-dev \
libopenjp2-7-dev \
libzstd-dev \
libwebp-dev \
cmake \
curl \
git
bash ci/gdal-compile.sh git ${{ inputs.gdal_ref }}

- name: Install dependencies
run: |
export PATH="${GDAL_DIR}/bin/:${PATH}"
python3.10 -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip
python -m pip wheel -r requirements-dev.txt
python -m pip install -r requirements-dev.txt
python -m pip install --no-deps --force-reinstall -e .[test]

- name: Test
shell: bash
run: |
export PATH="${GDAL_DIR}/bin/:${PATH}"
. testenv/bin/activate
python -m pytest -v -m "not wheel" -rxXs --cov rasterio --cov-report term-missing
25 changes: 25 additions & 0 deletions .github/workflows/test_gdal_dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test on signal from GDAL

on:
repository_dispatch:
types: [upstream_tag]
pull_request: # also build on PRs touching this file
paths:
- ".github/workflows/test_gdal_dispatch.yaml"
- ".github/workflows/test_gdal_build.yaml"
- "ci/gdal-compile.sh"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test_gdal_branch:
uses: ./.github/workflows/test_gdal_build.yaml
with:
gdal_ref: ${{ github.event.client_payload.tag || 'master' }}
rasterio_ref: ${{ matrix.branch }}
strategy:
fail-fast: false
matrix:
branch: ['main', 'maint-1.3']
75 changes: 7 additions & 68 deletions .github/workflows/test_gdal_latest.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Test GDAL Latest
name: Weekly tests against latest GDAL

on:
schedule:
- cron: '0 2 * * 1'
pull_request: # also build on PRs touching this file
paths:
- ".github/workflows/test_gdal_latest.yaml"
- ".github/workflows/test_gdal_build.yaml"
- "ci/gdal-compile.sh"

concurrency:
Expand All @@ -14,73 +15,11 @@ concurrency:

jobs:
test_gdal_latest:
name: GDAL Latest
runs-on: ubuntu-latest
container: ghcr.io/osgeo/proj:9.2.0
env:
GDAL_DIR: ${{ github.workspace }}/gdal_install
GDAL_DATA: ${{ github.workspace }}/gdal_install/share/gdal
LD_LIBRARY_PATH: "${{ github.workspace }}/gdal_install/lib/:${LD_LIBRARY_PATH}"
uses: ./.github/workflows/test_gdal_build.yaml
with:
gdal_ref: ${{ matrix.branch }}
rasterio_ref: ${{ github.ref }}
strategy:
fail-fast: false
matrix:
gdal-branch: ['master', 'release/3.7']
steps:
- uses: actions/checkout@v3
- name: Update
run: |
apt-get update
apt-get -y install software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update

- name: Set up Python
run: |
apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
python3.10-venv \
python3-pip \
g++

- name: Install GDAL
shell: bash
run: |
apt-get update
apt-get install -qq \
libcurl4-openssl-dev \
libtiff-dev \
libgeos-dev \
libjpeg-dev \
libnetcdf-dev \
libhdf4-alt-dev \
libhdf5-serial-dev \
libssl-dev \
libsqlite3-dev \
libexpat-dev \
libxerces-c-dev \
libpng-dev \
libopenjp2-7-dev \
libzstd-dev \
libwebp-dev \
cmake \
curl \
git
bash ci/gdal-compile.sh git ${{ matrix.gdal-branch }}

- name: Install dependencies
run: |
export PATH="${GDAL_DIR}/bin/:${PATH}"
python3.10 -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip
python -m pip wheel -r requirements-dev.txt
python -m pip install -r requirements-dev.txt
python -m pip install --no-deps --force-reinstall -e .[test]

- name: Test
shell: bash
run: |
export PATH="${GDAL_DIR}/bin/:${PATH}"
. testenv/bin/activate
python -m pytest -v -m "not wheel" -rxXs --cov rasterio --cov-report term-missing
branch: ['master', 'release/3.7']