Post-release: nullified version in antora.yml (#115) #836
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: push | |
| env: | |
| PYTHON_VERSIONS: '[ "3.9", "3.10", "3.11", "3.12", "3.13.3" ]' | |
| jobs: | |
| set-python-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python_versions: ${{ env.PYTHON_VERSIONS }} # Pass the env variable as an output | |
| steps: | |
| - name: Export PYTHON_VERSIONS | |
| run: echo "PYTHON_VERSIONS=$PYTHON_VERSIONS" >> $GITHUB_ENV | |
| static: | |
| name: Static analysis on Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| needs: set-python-matrix | |
| strategy: | |
| fail-fast: false # Ensure all matrix jobs run to completion | |
| matrix: | |
| python-version: ${{ fromJSON(needs.set-python-matrix.outputs.python_versions) }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install | |
| run: make install-dev | |
| - name: Run | |
| run: make lint | |
| test: | |
| name: Testing on Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| needs: set-python-matrix | |
| strategy: | |
| fail-fast: false # Ensure all matrix jobs run to completion | |
| matrix: | |
| python-version: ${{ fromJSON(needs.set-python-matrix.outputs.python_versions) }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install | |
| run: make install-dev | |
| - name: Run | |
| run: make coverage | |
| check-static-and-test-status: | |
| name: Verify All Jobs Succeeded | |
| runs-on: ubuntu-latest | |
| needs: [ static, test ] # Ensure all jobs complete before checking | |
| if: always() # This ensures the job runs even if previous jobs failed | |
| steps: | |
| - name: Check Job Results | |
| run: | | |
| # Initialize a flag to track failures | |
| FAILED=0 | |
| # Check the result of the 'static' job | |
| if [ "${{ needs.static.result }}" == "failure" ]; then | |
| echo "Static analysis job failed." | |
| FAILED=1 | |
| fi | |
| # Check the result of the 'test' job | |
| if [ "${{ needs.test.result }}" == "failure" ]; then | |
| echo "Test job failed." | |
| FAILED=1 | |
| fi | |
| # Exit with status 1 if any job failed | |
| if [ "$FAILED" -ne 0 ]; then | |
| echo "One or more jobs failed." | |
| exit 1 | |
| else | |
| echo "All jobs passed successfully." | |
| fi | |
| deploy: | |
| name: Build and publish to PyPI | |
| needs: check-static-and-test-status | |
| if: contains(github.ref, 'tags/v') # both v1.x.x & v2.X.X | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.9 | |
| - name: Install dependencies | |
| run: pip install -U setuptools wheel build | |
| - name: Build the package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.4.2 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| docs: | |
| name: Build and publish docs | |
| if: contains(github.ref, 'tags/v2.') # Only for version 2.X.X | |
| needs: deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Build | |
| run: make docs | |
| - name: Deploy | |
| uses: JamesIves/github-pages-deploy-action@4.1.1 | |
| with: | |
| branch: gh-pages | |
| folder: docs/build/site |