Skip to content

Fix for crash when docstrings are optimized out. Bug #321. #309

Fix for crash when docstrings are optimized out. Bug #321.

Fix for crash when docstrings are optimized out. Bug #321. #309

Workflow file for this run

name: CI
on:
push:
branches:
- stable
- main
- mxfp
- 4.1-update
tags:
- v*
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: Build ${{ matrix.os.name }} ${{ matrix.python.name }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: 🐧
runs-on: ubuntu-latest
python:
- name: CPython 3.10
major_dot_minor: '3.10'
action: '3.10'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# This allows the matrix to specify just the major.minor version while still
# expanding it to get the latest patch version including alpha releases.
# This avoids the need to update for each new alpha, beta, release candidate,
# and then finally an actual release version. actions/setup-python doesn't
# support this for PyPy presently so we get no help there.
#
# CPython -> 3.9.0-alpha - 3.9.X
# PyPy -> pypy-3.7
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python.action), matrix.python.action))[startsWith(matrix.python.action, 'pypy')] }}
architecture: x64
- name: Setup environment
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build sdist and wheel
run: |
python -m build
- name: Publish package files
if: always()
uses: actions/upload-artifact@v4
with:
name: packages
path: dist/*
if-no-files-found: error
test:
name: Test ${{ matrix.os.name }} ${{ matrix.python.name }}
needs:
- build
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: 🐧
runs-on: ubuntu-latest
- name: 🍎
runs-on: macos-latest
- name: πŸͺŸ
runs-on: windows-latest
python:
- name: CPython 3.8
major_dot_minor: '3.8'
action: '3.8'
- name: CPython 3.9
major_dot_minor: '3.9'
action: '3.9'
- name: CPython 3.10
major_dot_minor: '3.10'
action: '3.10'
- name: CPython 3.11
major_dot_minor: '3.11'
action: '3.11'
- name: CPython 3.12
major_dot_minor: '3.12'
action: '3.12'
# Failing due to error using temporary file in a unittest. I think it's a PyPy bug, not a bitstring one!
# - name: PyPy 3.8
# major_dot_minor: '3.8'
# action: 'pypy-3.8'
steps:
- uses: actions/checkout@v4
with:
path: repo
- name: Download package files
uses: actions/download-artifact@v4
with:
name: packages
path: dist
- uses: actions/setup-python@v5
with:
# This allows the matrix to specify just the major.minor version while still
# expanding it to get the latest patch version including alpha releases.
# This avoids the need to update for each new alpha, beta, release candidate,
# and then finally an actual release version. actions/setup-python doesn't
# support this for PyPy presently so we get no help there.
#
# CPython -> 3.9.0-alpha - 3.9.X
# PyPy -> pypy-3.7
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python.action), matrix.python.action))[startsWith(matrix.python.action, 'pypy')] }}
architecture: x64
- name: Setup environment
run: |
python --version --version
# make sure we test the installed code
cp -R repo/tests/ tests/
python -m pip install --upgrade pip
python -m pip install -r tests/requirements.txt
python -m pip install ./dist/*.whl
# show the directory contents for diagnostics
ls -la
- name: Run pytest
run: |
python -m pytest tests/
all:
name: All successful
runs-on: ubuntu-latest
# The always() part is very important.
# If not set, the job will be skipped on failing dependencies.
if: always()
needs:
# This is the list of CI job that we are interested to be green before
# a merge.
- build
- test
steps:
- name: Require all successes
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}