Skip to content

Commit

Permalink
ci: port from GitLab CI to GitHub Actions
Browse files Browse the repository at this point in the history
Use pre-commit commitlint instead of native.
  • Loading branch information
aentwist committed Mar 13, 2024
1 parent b264c18 commit 491fd6e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 30 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.platform: &platform
runs-on: ubuntu-latest
container:
image: python:3.12.2-slim-bookworm@sha256:5c73034c2bc151596ee0f1335610735162ee2b148816710706afec4757ad5b1e

.env: &pre-commit-env
env:
PIP_CACHE_DIR: .cache/pip
PRE_COMMIT_HOME: .cache/pre-commit

.steps:
- &checkout
name: Check out repository code
uses: actions/checkout@v4
- &cache-pre-commit
name: Cache pre-commit and pre-commit hooks
uses: actions/cache@v4
with:
path: .cache
- &install-pre-commit
name: Install pre-commit
run: |
apt update
apt install -y git
pip install -r requirements.txt
name: lint
on: push
jobs:
lint-commits:
<<: *platform
<<: *pre-commit-env
steps:
- *checkout
- *cache-pre-commit
- *install-pre-commit
- name: Check all commit messages
run: pre-commit run --hook-stage=manual commitlint-all

format:
<<: *platform
<<: *pre-commit-env
steps:
- *checkout
- *cache-pre-commit
- *install-pre-commit
- name: Check the formatting of all files
run: pre-commit run --all-files prettier
29 changes: 0 additions & 29 deletions .gitlab-ci.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ repos:
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies:
additional_dependencies: &commitlint-additional-dependencies
#
# renovate: datasource=npm
- commitlint@19.0.3
# renovate: datasource=npm
- "@commitlint/config-conventional@19.0.3"
- id: commitlint-all
stages: [manual]
additional_dependencies: *commitlint-additional-dependencies

0 comments on commit 491fd6e

Please sign in to comment.