CI: test that runs pdf pack examples in CI #3
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.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 and dependencies | |
run: | | |
conda install -y diffpy.cmi | |
conda install --file requirements/packs/core.txt -y | |
conda install --file requirements/packs/docs.txt -y | |
conda install --file requirements/packs/pdf.txt -y | |
conda install --file requirements/packs/plotting.txt -y | |
conda install --file requirements/packs/tests.txt -y | |
- 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.13] # requires manual update | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip and Install diffpy.cmi and other dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install diffpy.cmi | |
pip install -r requirements/packs/core.txt | |
pip install -r requirements/packs/docs.txt | |
pip install -r requirements/packs/pdf.txt | |
pip install -r requirements/packs/plotting.txt | |
pip install -r requirements/packs/tests.txt | |
- 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 |