Update GitHub Artifact Actions (major) #123
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit_tests: | |
| name: Unit testing | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install hatch | |
| run: | | |
| python -m pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| python -m hatch -v -e tests | |
| - name: Perform unit tests | |
| run: | | |
| python -m hatch -e tests run test | |
| test_benchmarks: | |
| name: Benchmarks API methods | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10"] | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install hatch | |
| run: | | |
| python -m pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| python -m hatch -v -e tests | |
| - name: Perform benchmarks | |
| run: | | |
| python -m hatch -e tests run benchmarks | |
| - name: Store benchmark result | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: stats | |
| path: docs/stats.json | |
| vqe_benchmarks: | |
| name: Benchmarks VQE state vector simulations | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10"] | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install hatch | |
| run: | | |
| python -m pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| python -m hatch -v -e tests | |
| - name: Perform benchmarks | |
| run: | | |
| python -m hatch -e tests run vqe | |
| - name: Store benchmark result | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: vqestatsnoshots | |
| path: docs/stats_vqe_noshots.json | |
| vqe_benchmarks_sampling: | |
| name: Benchmarks VQE with sampling | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10"] | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install hatch | |
| run: | | |
| python -m pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| python -m hatch -v -e tests | |
| - name: Perform benchmarks | |
| run: | | |
| python -m hatch -e tests run vqeshots | |
| - name: Store benchmark result | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: vqestatsshots | |
| path: docs/stats_vqe_shots.json | |
| dqc_benchmarks: | |
| name: Benchmarks DQC | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10"] | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install hatch | |
| run: | | |
| python -m pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| python -m hatch -v -e tests | |
| - name: Perform benchmarks | |
| run: | | |
| python -m hatch -e tests run dqc | |
| - name: Store benchmark result | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dqcstats | |
| path: docs/stats_dqc.json | |
| test_docs: | |
| name: Documentation | |
| needs: [test_benchmarks, vqe_benchmarks, vqe_benchmarks_sampling, dqc_benchmarks] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10"] | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install hatch | |
| run: | | |
| pip install --upgrade pip | |
| pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| hatch -v -e docs | |
| - name: Download benchmark API result | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: stats | |
| - name: Download benchmark VQE result | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: vqestatsnoshots | |
| - name: Download benchmark VQE result shots | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: vqestatsshots | |
| - name: Download benchmark DQC result | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: dqcstats | |
| - name: Test docs | |
| run: | | |
| python -m hatch -e docs run mkdocs build --clean --strict | |
| deploy_docs: | |
| name: Deploy documentation | |
| needs: test_docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main code and submodules | |
| uses: actions/checkout@v6 | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install hatch | |
| run: | | |
| pip install --upgrade pip | |
| pip install hatch | |
| - name: Install main dependencies | |
| run: | | |
| hatch -v -e docs | |
| - name: Download benchmark API result | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: stats | |
| - name: Download benchmark VQE result | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: vqestatsnoshots | |
| - name: Download benchmark VQE result shots | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: vqestatsshots | |
| - name: Download benchmark DQC result | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: dqcstats | |
| - name: Deploy docs with mike | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git fetch origin gh-pages | |
| hatch -v run docs:mike set-default latest | |
| hatch -v run docs:mike deploy --push latest |