Skip to content

Commit

Permalink
Refactor CI setup and add pre-commit configuration (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
borchero authored Dec 12, 2022
1 parent 725cde3 commit 3c86ebc
Show file tree
Hide file tree
Showing 28 changed files with 1,649 additions and 1,886 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @borchero
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
# Update GitHub actions
- directory: /
open-pull-requests-limit: 5
package-ecosystem: github-actions
schedule:
interval: weekly
day: saturday
# Update Python dependencies
- directory: /
open-pull-requests-limit: 5
package-ecosystem: pip
schedule:
interval: weekly
day: saturday
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI
on:
push:
branches: [main]
pull_request:

jobs:
pylint:
name: Pylint Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install poetry
uses: snok/install-poetry@v1
- name: Install project
run: poetry install --only main,pre-commit
- name: Run pylint
run: poetry run pylint **/*.py

unit-tests:
name: Unit Tests - Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
- name: Install project
run: poetry install --only main,testing
- name: Run Pytest
run: poetry run pytest tests
12 changes: 4 additions & 8 deletions .github/workflows/deploy.yaml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Deploy Package
on:
release:
types:
- published
types: [published]

jobs:
build:
Expand All @@ -12,12 +11,9 @@ jobs:
image: python:3.9-buster
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | \
python - \
&& echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
uses: actions/checkout@v3
- name: Install poetry
uses: snok/install-poetry@v1
- name: Tag
run: poetry version ${{ github.event.release.tag_name }}
- name: Build Wheel
Expand Down
21 changes: 7 additions & 14 deletions .github/workflows/docs.yaml → .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ on:
release:
types: [published]
push:
branches:
- master
branches: [main]
pull_request:
branches:
- master

jobs:
build:
Expand All @@ -20,21 +17,18 @@ jobs:
uses: actions/checkout@v2
- name: Install Enchant
run: apt-get update && apt-get install -y enchant
- name: Install Poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | \
python - \
&& echo "PATH=$HOME/.poetry/bin:$PATH" >> $GITHUB_ENV
- name: Install poetry
uses: snok/install-poetry@v1
- name: Install Dependencies
run: poetry install --no-interaction --no-ansi
run: poetry install --only main,docs
- name: Fix Disutils
run: poetry run pip install setuptools==59.5.0
- name: Check Spelling
run: poetry run sphinx-build -W -b spelling docs build
- name: Generate HTML
run: poetry run sphinx-build -W -b html docs build
- name: Store Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: html
path: build
Expand All @@ -43,11 +37,10 @@ jobs:
name: Publish
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
needs:
- build
needs: build
steps:
- name: Retrieve Artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: html
path: build
Expand Down
87 changes: 0 additions & 87 deletions .github/workflows/style.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/tests.yaml

This file was deleted.

Loading

0 comments on commit 3c86ebc

Please sign in to comment.