CI: test that runs pdf pack examples in CI #1
Workflow file for this run
This file contains hidden or 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: Test PDF Pack Scripts | |
on: | |
push: | |
branches: main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test-conda: | |
name: conda-${{ matrix.python-version }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.11, 3.12, 3.13] # requires manual update | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
- name: Install diffpy.cmi | |
run: | | |
conda install -y diffpy.cmi | |
- name: Run diffpy.cmi scripts from docs/examples | |
shell: bash | |
run: | | |
set -e | |
export MPLBACKEND=Agg | |
for script in docs/examples/ch*/solutions/diffpy-cmi/*.py; do | |
python "$script" | |
done | |
test-pip: | |
name: pip-${{ matrix.python-version }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: [3.11, 3.12, 3.13] # requires manual update | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install diffpy.cmi (pip) | |
run: | | |
python -m pip install --upgrade pip | |
pip install diffpy.cmi | |
- name: Run diffpy.cmi scripts from docs/examples | |
shell: bash | |
run: | | |
set -e | |
export MPLBACKEND=Agg | |
for script in docs/examples/ch*/solutions/diffpy-cmi/*.py; do | |
python "$script" | |
done |