Skip to content

Update support / release #522

Update support / release

Update support / release #522

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 65, Col: 13): Expected format {org}/{repo}[/path]@ref. Actual 'actions/upload-artifact#b7c566a772e6b6bfb58ed0dc250532a479d7789f', (Line: 72, Col: 13): Expected format {org}/{repo}[/path]@ref. Actual 'actions/upload-artifact#b7c566a772e6b6bfb58ed0dc250532a479d7789f'
on:
push:
pull_request:
permissions: {}
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout working copy
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
with:
submodules: true
fetch-depth: 0
persist-credentials: false
- name: ruff check
uses: astral/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # 3.5.1
- name: ruff format
if: always()
uses: astral/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # 3.5.1
with:
args: format --diff
- name: Set up Python
id: setup_python
if: always()
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
with:
python-version: "3.x"
- name: Install mypy
id: install_mypy
if: ${{ always() && steps.setup_python.conclusion == 'success' }}
run: |
python -mpip install --upgrade pip
python -mpip install mypy types-PyYaml ./ua-parser-builtins
- name: mypy
if: ${{ always() && steps.install_mypy.conclusion == 'success' }}
run: mypy
# REPLACE BY: job which python -mbuild, and uploads the sdist and wheel to artifacts
# build is not binary so can just build the one using whatever python version
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout working copy
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
with:
submodules: true
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
with:
python-version: "3.x"
- name: Install dependency
run: |
python -mpip install --upgrade pip
python -mpip install build
- name: Build sdist and wheel
run: |
python -mbuild
- name: Upload sdist
uses: actions/upload-artifact#b7c566a772e6b6bfb58ed0dc250532a479d7789f # 6.0.0
with:
name: sdist
path: dist/*.tar.gz
retention-days: 1
- name: Upload wheel
uses: actions/upload-artifact#b7c566a772e6b6bfb58ed0dc250532a479d7789f # 6.0.0
with:
name: wheel
path: dist/*.whl
retention-days: 1
test:
runs-on: ubuntu-latest
needs: compile
strategy:
fail-fast: false
matrix:
source:
- wheel
- sdist
- source
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.14t"
- "pypy-3.11"
- "graalpy-25"
include:
- source: sdist
artifact: dist/*.tar.gz
- source: wheel
artifact: dist/*.whl
- opts: ""
- python-version: graalpy-25
opts: "--experimental-options --engine.CompileOnly='~tregex re'"
steps:
- name: Checkout working copy
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # 6.0.1
with:
submodules: true
fetch-depth: 0
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- run: python -mpip install --upgrade pip
- run: |
# if binary wheels are not available for the current
# package install libyaml-dev so we can install pyyaml
# from source
if ! pip download --only-binary :all: pyyaml > /dev/null 2>&1; then
sudo apt install libyaml-dev
fi
- run: python -mpip install pytest pyyaml
- run: python -mpip install ./ua-parser-builtins
# install rs accelerator if available, ignore if not
- run: python -mpip install ua-parser-rs || true
# re2 is basically impossible to install from source so don't
# bother, and suppress installation failure so the test does
# not fail (re2 tests will just be skipped for versions /
# implementations for which google does not provide a binary
# wheel)
- run: 'python -mpip install --only-binary :all: google-re2 || true'
- name: download ${{ matrix.source }} artifact
if: matrix.artifact
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # 7.0.0
with:
name: ${{ matrix.source }}
path: dist/
- name: install package in environment
run: python -m pip install ${{ matrix.artifact || '.' }}
- name: run tests
run: python ${{ matrix.opts }} -m pytest -v -Werror -Wignore::ImportWarning --doctest-glob="*.rst" -ra
# necessary to create a unified CI result and not have to update
# branch protection rules every time the matrix gets updated
results:
name: "CI Results"
needs: ["checks", "test"]
runs-on: ubuntu-latest
permissions: {}
steps:
- run: exit 0