Skip to content

CI improvements

CI improvements #399

Workflow file for this run

name: Build PyWPS ⚙️
on:
push:
branches:
- main
pull_request:
concurrency:
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on main.
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
jobs:
lint:
name: Linting Suite
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python3.10
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.10"
cache: pip
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Run linting suite ⚙️
run: |
tox -e lint
test:
name: Testing with (Python${{ matrix.python-version }}, ${{ matrix.os }})
needs: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
os: ["ubuntu-latest"]
include:
# - python-version: "3.11"
# os: "windows"
- python-version: "3.11"
os: "macos-latest"
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install packages 📦 (Linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get -y install libnetcdf-dev libhdf5-dev
- name: Install packages 📦 (macOS)
if: ${{ matrix.os == 'macos-latest' }}
uses: tecolicom/actions-use-homebrew-tools@b9c066b79607fa3d71e0be05d7003bb75fd9ff34 # v1.3
with:
tools: hdf5 netcdf
cache: "yes"
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Run tests with tox ⚙️
run: |
tox
env:
TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }}
- name: Trust Coveralls Homebrew tap # Homebrew v6.0 requirement; Remove when coverallsapp/github-action >2.3.7
if: matrix.os == 'macos-latest'
run: |
brew trust coverallsapp/coveralls
- name: Report Coverage
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
flag-name: run-${{ matrix.python-version }}
parallel: true
docs:
name: Build docs 🏗️
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python3.10
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.10"
cache: pip
- name: Install CI libraries
run: |
python -m pip install --require-hashes -r CI/requirements_ci.txt
- name: Build documentation 🏗️
run: |
tox -e docs
finish:
name: Finish
needs:
- test
- docs
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
parallel-finished: true