Skip to content

Dl0 source

Dl0 source #32

Workflow file for this run

name: CI
# by not building all branches on push, we avoid the duplicated builds in PRs
on:
push:
branches:
- main
tags:
- '**'
pull_request:
env:
NUMBA_NUM_THREADS: 1
MPLBACKEND: Agg
PYTEST_ADDOPTS: --color=yes
jobs:
static-code-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: pre-commit/[email protected]
with:
extra_args: --files $(git diff origin/main --name-only)
tests:
strategy:
matrix:
include:
- python-version: "3.9"
os: ubuntu-latest
- python-version: "3.10"
os: ubuntu-latest
- python-version: "3.11"
os: ubuntu-latest
extra-args: ['codecov']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Build the package
run: |
pip install build
python -m build
- name: Install the package
run: pip install .[test]
- name: Install the package in editable mode
run: pip install --editable .[test]
- name: Test with pytest
run: |
pytest --cov --cov-report=xml --cov-branch \
--doctest-modules \
--ignore-glob="*/_dev_version" \
-v
- uses: codecov/codecov-action@v3
if: contains(matrix.extra-args, 'codecov')
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install doc dependencies
run: |
pip install -e .[doc]
git describe --tags
python -c 'import ctapipe_io_zfits ; print(ctapipe_io_zfits.__version__)'
- name: Build docs
run: make -C docs html SPHINXOPTS="-W --keep-going -n --color -j auto"
- name: Deploy to github pages
# only run on push to master
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/build/html
clean: true
single_commit: true