Skip to content

Commit

Permalink
Add CI (#1)
Browse files Browse the repository at this point in the history
* add CI

* fix readme, add pre-commit integration

* update readme

* fix underscore

* final updates

* add rst fmt

* do not use relative links for the rst file

* fix clang autoformatter

* Revert "fix clang autoformatter"

This reverts commit af89540.

* fix header order

* fix sdist

* add legends to benchmarks
  • Loading branch information
akaszynski authored Jul 18, 2023
1 parent 72863e0 commit 0edf65c
Show file tree
Hide file tree
Showing 10 changed files with 425 additions and 263 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build and upload

on:
pull_request:
push:
tags:
- "*"
branches:
- "main"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/cibuildwheel@v2.14.1

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.8.6
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
./dist/*.whl
12 changes: 11 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# See https://pre-commit.ci/
ci:
autofix_prs: true
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/psf/black
rev: 23.7.0
Expand Down Expand Up @@ -53,10 +58,15 @@ repos:
- id: clang-format
files: |
(?x)^(
stl_reader/cython/[^_].*\.c.*
stl_reader/[^_].*\.c.*
)$
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.3
hooks:
- id: check-github-workflows

- repo: https://github.com/dzhu/rstfmt
rev: v0.0.13
hooks:
- id: rstfmt
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include stl_reader/_stlfile_wrapper.pyx
global-exclude stl_reader/_stlfile_wrapper.c
Loading

0 comments on commit 0edf65c

Please sign in to comment.