-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from Lightmatter/develop
v0.1.2
- Loading branch information
Showing
54 changed files
with
3,894 additions
and
1,279 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Publish Python 🐍 package 📦 to PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
get-package-version: | ||
name: Get ${{ github.ref_name }} package version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
package-version: ${{ steps.package-version.outputs.package-version }} | ||
version-compairson: ${{ steps.semver.outputs.comparison-result}} | ||
steps: | ||
- name: Checkout ${{ github.repository }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Get package version | ||
id: package-version | ||
run: echo "package-version=v$(poetry version --short)" >> $GITHUB_OUTPUT | ||
|
||
- name: Get release version | ||
id: release-version | ||
uses: pozetroninc/github-action-get-latest-release@master | ||
with: | ||
repository: ${{ github.repository }} | ||
|
||
- name: Analyze semver | ||
id: semver | ||
uses: madhead/semver-utils@latest | ||
with: | ||
lenient: false | ||
version: ${{ steps.package-version.outputs.package-version }} | ||
compare-to: ${{ steps.release-version.outputs.release }} | ||
|
||
- name: Check pre-release | ||
if: ${{ steps.semver.outputs.prerelease != '' }} | ||
run: | | ||
echo "Checking if version is a pre-release" | ||
echo "::error::Skipping pre-release version: ${{ steps.package-version.outputs.package-version}}" | ||
exit 1 | ||
deploy: | ||
name: Deploy Python 🐍 distributions 📦 to PyPI | ||
needs: [get-package-version] | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.get-package-version.outputs.version-compairson != '=' }} | ||
|
||
steps: | ||
- name: Checkout ${{ github.repository }} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and publish to PyPI | ||
uses: JRubics/poetry-publish@v1.13 | ||
with: | ||
pypi_token: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Create release ${{ needs.get-package-version.outputs.package-version }} | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
commit: ${{ github.ref_name }} | ||
tag: ${{ needs.get-package-version.outputs.package-version }} | ||
generateReleaseNotes: true | ||
artifacts: | | ||
dist/*.whl | ||
dist/*.tar.gz |
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,77 @@ | ||
name: CI | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
get-python-versions: | ||
name: Get Python versions | ||
runs-on: ubuntu-latest | ||
outputs: | ||
python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }} | ||
steps: | ||
- name: Get Python version matrix | ||
uses: snok/latest-python-versions@v1 | ||
id: get-python-versions-action | ||
with: | ||
min-version: 3.8 | ||
|
||
ci: | ||
name: CI | ||
needs: [get-python-versions] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }} | ||
|
||
steps: | ||
- name: Checkout ${{ github.repository }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached environment | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
id: poetry-install | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run pre-commit | ||
run: poetry run pre-commit run --all-files | ||
|
||
- name: Run Tests | ||
run: | | ||
poetry run pytest \ | ||
--junitxml=pytest.xml \ | ||
--cov-report=term-missing:skip-covered \ | ||
--cov=welkin | tee pytest-coverage.txt | ||
- name: Add coverage comment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
continue-on-error: true | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
report-only-changed-files: true | ||
title: Coverage Report (Python ${{ matrix.python-version }}) | ||
unique-id-for-comment: ${{ matrix.python-version }} | ||
remove-link-from-badge: true |
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,26 @@ | ||
name: Pre-commit auto-update | ||
|
||
on: | ||
# every day at midnight | ||
schedule: | ||
- cron: "0 0 * * *" | ||
# on demand | ||
workflow_dispatch: | ||
|
||
jobs: | ||
auto-update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
|
||
- uses: browniebroke/pre-commit-autoupdate-action@main | ||
|
||
- uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: update/pre-commit-hooks | ||
title: Update pre-commit hooks | ||
commit-message: "chore: update pre-commit hooks" | ||
body: Update versions of pre-commit hooks to latest version. |
This file was deleted.
Oops, something went wrong.
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
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,21 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-yaml | ||
args: [--unsafe] | ||
- id: debug-statements | ||
- id: mixed-line-ending | ||
|
||
## Python | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
types: [python] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
types: [python] |
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
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
Oops, something went wrong.