Add a new callbacks nb and fix a cross-entropy bug found due to new pennylane ver #83
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| code-quality: | |
| name: code-quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: repository checkout step | |
| uses: actions/checkout@v7 | |
| - name: python environment step | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| - name: install pre-commit | |
| run: python3 -m pip install pre-commit | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get changed files | |
| id: changed-files | |
| run: | | |
| CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | tr '\n' ' ') | |
| echo "CHANGED_FILES=${CHANGED_FILES}" >> $GITHUB_ENV | |
| - name: Print changed files | |
| run: | | |
| echo "Changed files:" && echo "$CHANGED_FILES" | tr ' ' '\n' | |
| - name: Run pre-commit on changed files | |
| run: | | |
| if [ -n "$CHANGED_FILES" ]; then | |
| pre-commit run --color always --files $CHANGED_FILES --show-diff-on-failure | |
| else | |
| echo "No changed files to check." | |
| fi | |
| run-notebook-tutorials: | |
| name: Run notebook tutorials | |
| needs: code-quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install ".[dev,all_extras,github-actions]" | |
| - name: Show dependencies | |
| run: python -m pip list | |
| - name: Run example notebooks | |
| run: build_tools/run_examples.sh | |
| shell: bash | |
| pytest-nosoftdeps: | |
| name: no-softdeps | |
| needs: code-quality | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Get full Python version | |
| id: full-python-version | |
| shell: bash | |
| run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| pip install ".[dev]" | |
| - name: Show dependencies | |
| run: python -m pip list | |
| - name: Run pytest | |
| shell: bash | |
| run: python -m pytest | |
| pytest-all-extras: | |
| name: Run pytest | |
| needs: pytest-nosoftdeps | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install libomp # https://github.com/pytorch/pytorch/issues/20030 | |
| - name: Get full Python version | |
| id: full-python-version | |
| shell: bash | |
| run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| pip install ".[dev,all_extras]" | |
| - name: Show dependencies | |
| run: python -m pip list | |
| - name: Run pytest | |
| shell: bash | |
| run: python -m pytest |