Skip to content

Update the continuous integration workflows #616

Update the continuous integration workflows

Update the continuous integration workflows #616

Workflow file for this run

# Workflow to automate installation and unit testing of DeltaMetrics on various python versions and operating systems
name: build
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *' # run workflow at 12AM on first day of every month
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install nox
- name: Test with pytest
run: |
nox -s coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
lint:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install nox
run: pip install nox
- name: Run the linters
run: nox -s lint
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install nox
sudo apt update -y && sudo apt install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended dvipng ffmpeg
- name: Build and test documentation
run: |
nox -s docs
- name: Debug
run: |
echo $REF
echo $EVENT_NAME
echo ${{ github.event_name == 'push' }}
echo ${{ github.ref == 'refs/heads/develop' }}
echo ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
BRANCH: gh-pages
FOLDER: docs/build/html