Auto-update pre-commit hooks #1575
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
- "pre-commit-autoupdate" | |
tags: | |
- "*" | |
schedule: | |
# daily (`@daily` not supported, see | |
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events ) | |
# | |
# Runs on default/base branch (see | |
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule ) | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
numfocus_nightly: [false] | |
os: ["ubuntu-latest"] | |
pandas: [""] | |
pyarrow: ["4.0.1", "nightly"] | |
python: ["3.10"] | |
include: | |
- numfocus_nightly: true | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "nightly" | |
python: "3.10" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "1.5.3" | |
pyarrow: "13.0.0" | |
python: "3.11" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "7.0.0" | |
python: "3.10" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "8.0.1" | |
python: "3.10" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "9.0.0" | |
python: "3.10" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "10.0.1" | |
python: "3.11" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "11.0.0" | |
python: "3.11" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "12.0.0" | |
python: "3.11" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "13.0.0" | |
python: "3.11" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "13.0.0" | |
python: "3.12" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "14.0.1" | |
python: "3.12" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "15.0.0" | |
python: "3.12" | |
- numfocus_nightly: false | |
os: "ubuntu-latest" | |
pandas: "" | |
pyarrow: "18.1.0" | |
python: "3.12" | |
continue-on-error: ${{ matrix.numfocus_nightly || matrix.pyarrow == 'nightly' }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
# see https://github.com/conda-incubator/setup-miniconda/#important | |
shell: bash -l {0} | |
env: | |
IS_MASTER_BUILD: ${{ !matrix.numfocus_nightly && matrix.os == 'ubuntu-latest' && matrix.pyarrow == '4.0.1' && matrix.python == '3.8' }} | |
IS_TAG: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')}} | |
steps: | |
# CI setup | |
- name: Is Master Build? | |
run: echo $IS_MASTER_BUILD | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Conda env | |
uses: mamba-org/setup-micromamba@06375d89d211a1232ef63355742e9e2e564bc7f7 | |
with: | |
environment-file: environment.yml | |
cache-environment: true | |
create-args: >- | |
python=${{ matrix.python }} | |
- name: Install Pyarrow (non-nightly) | |
run: micromamba install -y pyarrow==${{ matrix.pyarrow }} | |
if: matrix.pyarrow != 'nightly' && matrix.pandas == '' | |
- name: Install Pyarrow (nightly) | |
# Install both arrow-cpp and pyarrow to make sure that we have the | |
# latest nightly of both packages. It is sadly not guaranteed that the | |
# nightlies and the latest release would otherwise work together. | |
run: micromamba update -c arrow-nightlies -c conda-forge arrow-cpp pyarrow | |
if: matrix.pyarrow == 'nightly' | |
- name: Install Pyarrow (downgrade pandas) | |
run: micromamba install -y --no-py-pin pyarrow==${{ matrix.pyarrow }} pandas==${{ matrix.pandas }} | |
if: matrix.pyarrow != 'nightly' && matrix.pandas != '' | |
- name: Pip Install NumFOCUS nightly | |
# NumFOCUS nightly wheels, contains numpy and pandas | |
# TODO(gh-45): Re-add numpy | |
run: python -m pip install --pre --upgrade --timeout=60 --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/ pandas | |
if: matrix.numfocus_nightly | |
- name: Install repository | |
run: python -m pip install --no-build-isolation --no-deps --disable-pip-version-check -e . | |
- name: Test import | |
run: | | |
python -c "import plateau" | |
python -c "import plateau.api" | |
python -c "import plateau.api.dataset" | |
python -c "import plateau.api.serialization" | |
python -c "import plateau.core" | |
python -c "import plateau.io" | |
python -c "import plateau.io_components" | |
python -c "import plateau.serialization" | |
python -c "import plateau.utils" | |
# Tests | |
- name: Pytest | |
# FIXME: Add `-n auto` again to allow for parallelism here. | |
run: pytest --cov --cov-report xml | |
- name: Running benchmarks | |
run: | | |
asv --config ./asv_bench/asv.conf.json machine --machine github --os unknown --arch unknown --cpu unknown --ram unknown | |
asv --config ./asv_bench/asv.conf.json run -E existing:same | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log | |
if grep "failed" benchmarks.log > /dev/null ; then | |
exit 1 | |
fi | |
if: env.IS_MASTER_BUILD == 'true' | |
# Builds | |
- name: Build Wheel and sdist | |
run: python -m build --no-isolation | |
- name: Codecov | |
uses: codecov/codecov-action@v5.0.7 | |
with: | |
file: ./coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
name: pytest-numfocus_nightly_${{ matrix.numfocus_nightly }}-os_${{ matrix.os }}-pyarrow_${{ matrix.pyarrow }}-python_${{ matrix.python }} | |
# Release | |
- name: Publish to PyPI | |
if: env.IS_MASTER_BUILD == 'true' && env.IS_TAG == 'true' | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} |