Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
misc: pre-commit

misc: add char run configs

fix: pre-commit config
  • Loading branch information
violet-black committed Apr 7, 2024
0 parents commit 28ea660
Show file tree
Hide file tree
Showing 42 changed files with 3,081 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "coverage"

on:
push:
branches: [ master ]
paths: [ 'src', 'tests' ]
pull_request:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Python install
uses: actions/setup-python@v2
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
pip install coverage
- name: Tests
run: |
coverage run -m pytest
coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: violet-black/jsonschema-gen

- name: Upload coverage locally
uses: actions/upload-artifact@v3
with:
name: jsonschema-gen
path: coverage.xml
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on:
pull_request:
branches: [ master ]
push:
branches: [ master ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
43 changes: 43 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "publish"

on:
push:
tags:
- "*"

jobs:

pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/jsonschema-gen/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Test
run: |
pip install -U pip setuptools wheel
pip install -e .[test]
pytest
- name: Build
run: |
pip install build twine
python -m build --wheel --outdir dist/
twine check dist/*.whl
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: jsonschema-gen
path: dist/*.whl
29 changes: 29 additions & 0 deletions .github/workflows/py310.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "3.10"

on:
push:
branches: [ master ]
paths: [ 'src', 'tests' ]
pull_request:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Python install
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
- name: Tests
run: |
pytest
29 changes: 29 additions & 0 deletions .github/workflows/py311.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "3.11"

on:
push:
branches: [ master ]
paths: [ 'src', 'tests' ]
pull_request:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Python install
uses: actions/setup-python@v2
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
- name: Tests
run: |
pytest
29 changes: 29 additions & 0 deletions .github/workflows/py312.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "3.12"

on:
push:
branches: [ master ]
paths: [ 'src', 'tests' ]
pull_request:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Python install
uses: actions/setup-python@v2
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
- name: Tests
run: |
pytest
29 changes: 29 additions & 0 deletions .github/workflows/py38.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "3.8"

on:
push:
branches: [ master ]
paths: [ 'src', 'tests' ]
pull_request:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Python install
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
- name: Tests
run: |
pytest
29 changes: 29 additions & 0 deletions .github/workflows/py39.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "3.9"

on:
push:
branches: [ master ]
paths: [ 'src', 'tests' ]
pull_request:
branches: [ master ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Python install
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e .[test]
- name: Tests
run: |
pytest
Loading

0 comments on commit 28ea660

Please sign in to comment.