build(deps): bump prefix-dev/setup-pixi from 0.8.1 to 0.9.4 #49
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: Run tests on pull requests | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| env: | |
| OPENAI_API_KEY: dummy_key | |
| jobs: | |
| check-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has-code-changes: ${{ steps.changes.outputs.has-code-changes }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for code changes | |
| id: changes | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| echo "has-code-changes=true" >> $GITHUB_OUTPUT | |
| else | |
| # For pull requests, check if there are non-docs changes | |
| if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -v '^docs/' | grep -v '\.md$' | grep -q .; then | |
| echo "has-code-changes=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has-code-changes=false" >> $GITHUB_OUTPUT | |
| fi | |
| fi | |
| test-matrix: | |
| needs: check-changes | |
| runs-on: ubuntu-latest | |
| name: ${{ matrix.test-type }} (Python ${{ matrix.python-version }}, ${{ matrix.environment-type }}) | |
| if: ${{ needs.check-changes.outputs.has-code-changes == 'true' }} | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| environment-type: ['pixi'] | |
| test-type: ['unit-tests', 'smoke-tests'] | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Update apt and install curl | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y curl | |
| # Setup Pixi if needed | |
| - name: Setup Pixi Environment | |
| if: ${{ matrix.environment-type == 'pixi' }} | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| pixi-version: latest | |
| cache: true | |
| # Run the appropriate test based on matrix variables | |
| - name: Run unit tests | |
| if: ${{ matrix.test-type == 'unit-tests' }} | |
| run: pixi run -e tests test | |
| - name: Run smoke tests (pixi) | |
| if: ${{ matrix.test-type == 'smoke-tests' && github.repository_owner == 'matdagommer' }} | |
| run: pixi run pyml --help | |
| # Upload code coverage only for unit tests | |
| - name: Upload code coverage | |
| if: ${{ matrix.test-type == 'unit-tests' }} | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| verbose: true |