Skip to content

Commit

Permalink
▶️ Set up CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
OLILHR committed Jul 30, 2024
1 parent 0a5524b commit 2277de5
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "🤖 "
reviewers:
- "OLILHR"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "🤖 "
reviewers:
- "OLILHR"
15 changes: 15 additions & 0 deletions .github/workflows/byte_order_marks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Prevent byte order marks

on:
push:
branches:
- main
pull_request: {}

jobs:
bom-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: arma-actions/bom-check@v1
name: Check for BOM
19 changes: 19 additions & 0 deletions .github/workflows/dependabot_automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Dependabot auto-approve/-merge"

on: pull_request

jobs:
dependabot:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Approve pull request
run: gh pr review --approve "$PR_URL"
- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
27 changes: 27 additions & 0 deletions .github/workflows/dev_environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Test dev environment"

on:
push:
branches:
- main
pull_request: {}
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Create dev environment
run: |
tox -e dev
28 changes: 28 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Formatting"

on:
push:
branches:
- main
pull_request: {}
jobs:
black:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]
tool: ["black", "isort"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements/requirements-formatting.txt
- name: ${{ matrix.tool }} code formatter
run: |
${{ matrix.tool }} . --check
29 changes: 29 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Linting"

on:
push:
branches:
- main
pull_request: {}
jobs:
pylint:
name: Maintain code quality
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.12"]
os: [ubuntu-latest]
linter-env: ["linting", "typechecking", "spellchecking"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run ${{ matrix.linter-env }} via tox
run: |
tox -e ${{ matrix.linter-env }}

0 comments on commit 2277de5

Please sign in to comment.