summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.github/workflows/checks.yml44
1 files changed, 28 insertions, 16 deletions
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 1ca2a9c..39b3782 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -7,21 +7,21 @@ jobs:
runs-on: "ubuntu-latest"
strategy:
matrix:
- python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", pypy3]
+ python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", pypy-3.9]
os: ["macos-latest", "ubuntu-latest"]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3.0.2
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout pull request HEAD commit instead of merge commit
# Because gitlint is a tool that uses git itself under the hood, we remove git tracking from the checked out
- # code by temporarily renaming the .git directory.
+ # code by temporarily renaming the .git directory.
# This is to ensure that the tests don't have a dependency on the version control of gitlint itself.
- name: Temporarily remove git version control from code
run: mv .git ._git
- name: Setup python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
@@ -40,16 +40,28 @@ jobs:
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
# run: coveralls
+ # Patch the commit-msg hook to make it work in GH CI
+ # Specifically, within the commit-msg hook, wrap the invocation of gitlint with `script`
+
+ - name: Patch commit-msg hook
+ run: |
+ # Escape " to \"
+ sed -i -E '/^gitlint/ s/"/\\"/g' gitlint-core/gitlint/files/commit-msg
+ # Replace `gitlint <args>` with `script -e -q -c "gitlint <args>"`
+ sed -i -E 's/^gitlint(.*)/script -e -q -c "\0"/' gitlint-core/gitlint/files/commit-msg
+
- name: Integration Tests
run: ./run_tests.sh -i
- - name: Integration Tests (GITLINT_USE_SH_LIB=0)
+ # Gitlint no longer uses `sh` by default, but for now we're still supporting the manual enablement of it.
+ # By setting GITLINT_USE_SH_LIB=1, we test whether this still works.
+ - name: Integration Tests (GITLINT_USE_SH_LIB=1)
env:
- GITLINT_USE_SH_LIB: 0
+ GITLINT_USE_SH_LIB: 1
run: ./run_tests.sh -i
- - name: PEP8
- run: ./run_tests.sh -p
+ - name: Code formatting (black)
+ run: ./run_tests.sh -f
- name: PyLint
run: ./run_tests.sh -l
@@ -79,25 +91,25 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
- python-version: [3.6]
+ python-version: ["3.10"]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3.0.2
with:
ref: ${{ github.event.pull_request.head.sha }} # Checkout pull request HEAD commit instead of merge commit
# Because gitlint is a tool that uses git itself under the hood, we remove git tracking from the checked out
- # code by temporarily renaming the .git directory.
+ # code by temporarily renaming the .git directory.
# This is to ensure that the tests don't have a dependency on the version control of gitlint itself.
- name: Temporarily remove git version control from code
run: Rename-Item .git ._git
-
+
- name: Setup python
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
- name: "Upgrade pip on Python 3"
- if: matrix.python-version == '3.6'
+ if: matrix.python-version == '3.10'
run: python -m pip install --upgrade pip
- name: Install requirements
@@ -126,8 +138,8 @@ jobs:
run: pytest -rw -s qa
continue-on-error: true # Known to fail at this point
- - name: PEP8
- run: flake8 gitlint-core qa examples
+ - name: Code formatting (black)
+ run: black .
- name: PyLint
run: pylint gitlint-core\gitlint qa --rcfile=".pylintrc" -r n