PyPI package tests #144
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: 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.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| # Set the environment variables to be used in all jobs defined in this workflow | |
| env: | |
| CI_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} | |
| 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 easypeasy | |
| - name: Set the minimum system requirements | |
| working-directory: easypeasy | |
| run: pixi project system-requirements add macos 14.0 | |
| - name: Add Python 3.13 from Conda | |
| working-directory: easypeasy | |
| run: pixi add "python=3.13" | |
| - name: Add other Conda dependencies | |
| working-directory: easypeasy | |
| run: pixi add gsl | |
| - name: Add easypeasy (with dev dependencies) from PyPI | |
| working-directory: easypeasy | |
| run: pixi add --pypi "easypeasy[dev]" | |
| - name: Run unit tests to verify the installation | |
| working-directory: easypeasy | |
| run: pixi run python -m pytest ../tests/unit/ --color=yes -v | |
| - name: Run functional tests to verify the installation | |
| working-directory: easypeasy | |
| run: pixi run python -m pytest ../tests/functional/ --color=yes -v | |
| - name: Run integration tests to verify the installation | |
| working-directory: easypeasy | |
| 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 |