Skip to content

PyPI package tests #185

PyPI package tests

PyPI package tests #185

Workflow file for this run

name: PyPI package tests
on:
# Run daily, at 00:00.
schedule:
- cron: '0 0 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent workflow, skipping runs queued between the run
# in-progress and latest queued. And cancel in-progress runs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Job 1: Test installation from PyPI on multiple OS
pypi-package-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up pixi
uses: ./.github/actions/setup-pixi
with:
environments: ''
activate-environment: ''
run-install: false
frozen: false
- name: Init pixi project
run:
pixi init --platform linux-64 --platform osx-arm64 --platform win-64
easydiffraction
- name: Configure pixi platforms
working-directory: easydiffraction
run: |
pixi workspace platform edit linux-64 --glibc 2.35 --no-install
pixi workspace platform edit osx-arm64 --macos 14.0 --no-install
- name: Add Python 3.14
working-directory: easydiffraction
run: pixi add "python=3.14"
# GNU Scientific Library (required by diffpy.pdffit2)
# libc++ for macOS (required by diffpy.pdffit2)
- name: Add other Conda dependencies
working-directory: easydiffraction
run: |
pixi add gsl
pixi add --platform osx-arm64 libcxx
- name: Add easydiffraction (with dev dependencies) from PyPI
working-directory: easydiffraction
run: pixi add --pypi "easydiffraction[dev]"
- name: Run unit tests to verify the installation
working-directory: easydiffraction
run: pixi run python -m pytest ../tests/unit/ --color=yes -v
- name: Run functional tests to verify the installation
if: ${{ !cancelled() }}
working-directory: easydiffraction
run: pixi run python -m pytest ../tests/functional/ --color=yes -v
- name: Run integration tests to verify the installation
if: ${{ !cancelled() }}
working-directory: easydiffraction
run: pixi run python -m pytest ../tests/integration/ --color=yes -n auto
# Job 2: Build and publish dashboard (reusable workflow)
run-reusable-workflows:
needs: pypi-package-tests # depend on previous job
uses: ./.github/workflows/dashboard.yml
secrets: inherit