forked from darvid/python-hyperscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: ♻️ tooling, packaging, and CI/CD overhaul, and update to Hy…
…perscan 5.4.2
- Loading branch information
Showing
25 changed files
with
2,148 additions
and
2,200 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
.vscode | ||
build | ||
dist | ||
wheelhouse |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Lint | ||
|
||
on: | ||
- pull_request_target | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
# setting any permission will set everything else to none for GITHUB_TOKEN | ||
permissions: | ||
pull-requests: none | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install pytest ruff black | ||
- name: Format with clang-format | ||
uses: DoozyX/clang-format-lint-action@v0.11 | ||
with: | ||
source: "./src" | ||
extensions: "c" | ||
clangFormatVersion: 9 | ||
inplace: True | ||
|
||
- name: Format with black | ||
uses: psf/black@stable | ||
with: | ||
options: "--verbose" | ||
src: "./src" | ||
version: "~= 23.0" | ||
|
||
- name: Format with ruff | ||
uses: chartboost/ruff-action@v1 | ||
with: | ||
src: "./src" | ||
args: check --fix | ||
|
||
- name: Commit formatting changes | ||
uses: EndBug/add-and-commit@v4 | ||
with: | ||
message: "style: autoformatting" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Semantic release | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: release | ||
permissions: | ||
id-token: write | ||
if: github.repository == 'darvid/python-hyperscan' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheelhouse | ||
path: wheelhouse | ||
|
||
- name: Semantic release | ||
id: release | ||
uses: python-semantic-release/python-semantic-release@v8.0.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Build wheels | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- "v[0-9]+.[0-9]+" | ||
tags: | ||
- "v*" | ||
pull_request: | ||
branches: | ||
- main | ||
- "v[0-9]+.[0-9]+" | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }} | ||
runs-on: ${{ matrix.os }} | ||
if: github.repository == 'darvid/python-hyperscan' | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# TODO: Windows support | ||
# Linux 64 bit manylinux2014 | ||
- os: ubuntu-latest | ||
python: 3.8 | ||
python_id: 38 | ||
platform_id: manylinux_x86_64 | ||
- os: ubuntu-latest | ||
python: 3.9 | ||
python_id: 39 | ||
platform_id: manylinux_x86_64 | ||
- os: ubuntu-latest | ||
python: 3.10 | ||
python_id: 310 | ||
platform_id: manylinux_x86_64 | ||
- os: ubuntu-latest | ||
python: 3.11 | ||
python_id: 311 | ||
platform_id: manylinux_x86_64 | ||
|
||
# Linux 64 bit musllinux | ||
- os: ubuntu-latest | ||
python: 3.8 | ||
python_id: 38 | ||
platform_id: musslinux_1_1 | ||
- os: ubuntu-latest | ||
python: 3.9 | ||
python_id: 39 | ||
platform_id: musslinux_1_1 | ||
- os: ubuntu-latest | ||
python: 3.10 | ||
python_id: 310 | ||
platform_id: musslinux_1_1 | ||
- os: ubuntu-latest | ||
python: 3.11 | ||
python_id: 311 | ||
platform_id: musslinux_1_1 | ||
|
||
# MacOS x86_64 | ||
- os: macos-latest | ||
python: 3.8 | ||
python_id: 38 | ||
platform_id: macosx_x86_64 | ||
- os: macos-latest | ||
python: 3.9 | ||
python_id: 39 | ||
platform_id: macosx_x86_64 | ||
- os: macos-latest | ||
python: 3.10 | ||
python_id: 310 | ||
platform_id: macosx_x86_64 | ||
- os: macos-latest | ||
python: 3.11 | ||
python_id: 311 | ||
platform_id: macosx_x86_64 | ||
|
||
steps: | ||
- name: Checkout python-hyperscan | ||
uses: actions/checkout@v3 | ||
|
||
- uses: pdm-project/setup-pdm@v3 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: true | ||
|
||
- name: Python Semantic Release | ||
uses: python-semantic-release/python-semantic-release@v8.0.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
push: "false" | ||
|
||
- name: Build source distribution | ||
run: | | ||
pdm build --no-wheel | ||
- name: Build and test wheels | ||
env: | ||
CIBW_BUILD: cp${{ matrix.python_id }}-${{ matrix.platform_id }} | ||
CIBW_BUILD_VERBOSITY: 1 | ||
run: bash ./build_tools/wheels/build_wheels.sh | ||
|
||
- name: Store artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: | | ||
dist/*.tar.gz | ||
wheelhouse/*.whl |
Oops, something went wrong.