Skip to content

Fixing maxchars for macos + update of github workflow #205

Fixing maxchars for macos + update of github workflow

Fixing maxchars for macos + update of github workflow #205

Workflow file for this run

name: testing
on:
push:
branches:
- develop
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.13'
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv pip install --system .[msonable,tests,dev]
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure
build-test-bench:
name: "Build test bench containers"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test bench container
uses: docker/bake-action@v6
with:
load: true
push: false
files: tests/integration/dockerfiles/docker-bake.hcl
set: |
*.cache-to=type=gha,scope=global,mode=max
*.cache-from=type=gha,scope=global
test:
needs: [build-test-bench]
strategy:
matrix:
config:
- { os: macos-latest, python: "3.9", resolution: lowest-direct }
- { os: ubuntu-latest, python: "3.9", resolution: lowest-direct }
- { os: ubuntu-latest, python: "3.9", resolution: highest }
- { os: ubuntu-latest, python: "3.10", resolution: highest }
- { os: ubuntu-latest, python: "3.11", resolution: highest }
- { os: ubuntu-latest, python: "3.12", resolution: highest }
- { os: ubuntu-latest, python: "3.13", resolution: highest }
- { os: ubuntu-latest, python: "3.14", resolution: lowest-direct }
- { os: macos-latest, python: "3.14", resolution: highest }
- { os: ubuntu-latest, python: "3.14", resolution: highest }
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Set up Docker Buildx
if: matrix.config.os == 'ubuntu-latest'
uses: docker/setup-buildx-action@v3
- name: List images
if: matrix.config.os == 'ubuntu-latest'
run: docker images
- name: Load test bench containers
if: matrix.config.os == 'ubuntu-latest'
uses: docker/bake-action@v6
with:
load: true
push: false
files: tests/integration/dockerfiles/docker-bake.hcl
set: |
*.cache-to=type=gha,scope=global,mode=max
*.cache-from=type=gha,scope=global
- name: List images
if: matrix.config.os == 'ubuntu-latest'
run: docker images
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv pip install --system .[msonable,remote,tests] --resolution=${{ matrix.config.resolution }}
- name: Test
if: matrix.config.os == 'ubuntu-latest'
run: pytest --cov=qtoolkit --cov-report=xml
- name: Test macos (no integration)
if: matrix.config.os == 'macos-latest'
run: pytest --ignore=tests/integration --cov=qtoolkit --cov-report=xml
- name: Upload coverage to Codecov
if: matrix.config.os == 'ubuntu-latest' && matrix.config.python == '3.13' && matrix.config.resolution == 'highest'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: matgenix/qtoolkit
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.13'
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install -U pip
pip install uv
# Required to generate rst files from markdown
sudo apt install pandoc
uv pip install --system .[docs]
- name: Build Sphinx docs
working-directory: doc
run: |
# cannot use sphinx build directly as the makefile handles generation
# of some rst files
make html