Bump actions/download-artifact from 5 to 7 (#262) #640
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: CI | |
| on: | |
| pull_request: | |
| branches: ['main'] | |
| types: [opened, reopened, ready_for_review, synchronize] | |
| push: | |
| branches: ['main'] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Upgrade pip and install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install setuptools wheel build | |
| - name: Build the package | |
| run: | | |
| python -m build | |
| - name: Upload built package | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: built-package | |
| path: dist/*.whl | |
| test: | |
| if: github.event.pull_request.draft == false | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Download built package | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: built-package | |
| path: dist | |
| - name: Install package wheel with extras | |
| run: | | |
| pip install --upgrade pip | |
| pip install setuptools | |
| pip install -r requirements-test.txt | |
| bin/install_wheel_extras.sh dist --extra qasm3 --extra cirq --extra squin | |
| - name: Run tests with pyqir 0.11.x (typed pointers) | |
| run: | | |
| pip install "pyqir>=0.10.0,<0.12" | |
| pytest tests/ --cov=qbraid_qir --cov-report=term --cov-report= --cov-config=pyproject.toml -q | |
| pip install coverage | |
| mkdir -p cov_runs | |
| python -m coverage combine --data-file=cov_runs/.coverage.run1 .coverage | |
| - name: Run tests with pyqir 0.12+ (opaque pointers) | |
| run: | | |
| pip install "pyqir>=0.12.0,<0.13.0" | |
| pytest tests/ --cov=qbraid_qir --cov-report=term --cov-report= --cov-config=pyproject.toml -q | |
| python -m coverage combine --data-file=cov_runs/.coverage.run2 .coverage | |
| - name: Combine coverage and generate report | |
| run: | | |
| python -m coverage combine cov_runs/.coverage.run1 cov_runs/.coverage.run2 | |
| python -m coverage report | |
| mkdir -p build/coverage | |
| python -m coverage xml -o build/coverage/coverage.xml | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.11' | |
| uses: codecov/codecov-action@v5.5.2 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| files: ./build/coverage/coverage.xml | |
| verbose: true |