summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md13
-rw-r--r--.github/workflows/checks.yml44
2 files changed, 47 insertions, 10 deletions
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..db7f144
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,13 @@
+<!--- THIS IS A COMMENT BLOCK, REMOVE IT BEFORE SUBMITTING YOUR PR
+
+Thank you for your interest in gitlint and putting in the effort to create a PR!
+
+A few quick notes:
+
+- It's really just me (https://github.com/jorisroovers) maintaining gitlint, and I do so in a hobby capacity. More recently it has become harder for me to find time to maintain gitlint on a regular basis, which in practice means that it might take me a while (sometimes months) to get back to you. Rest assured though, I absolutely look at all PRs as soon as they come in - I just tend to only "work" on gitlint a few times a year.
+- Similarly, after your code is merged, it typically still takes months before I do another release that contains your code. Please don't let that deter you from contributing - I appreciate your patience and understanding!
+- Please review: http://jorisroovers.github.io/gitlint/contributing/
+
+-->
+
+Enter your PR details here
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index 348fb47..710245c 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -1,19 +1,27 @@
name: Tests and Checks
-on: [push]
+on: [push, pull_request]
jobs:
checks:
runs-on: "ubuntu-latest"
strategy:
matrix:
- python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3]
+ python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3]
os: ["macos-latest", "ubuntu-latest"]
steps:
- uses: actions/checkout@v2
+ 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.
+ # 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@v1
+ uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
@@ -57,24 +65,36 @@ jobs:
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
+ # Re-add git version control so we can run gitlint on itself.
+ - name: Re-add git version control to code
+ run: mv ._git .git
+
- name: Gitlint check
- run: ./run_tests.sh -g
+ run: ./run_tests.sh -g --debug
windows-checks:
runs-on: windows-latest
strategy:
matrix:
- python-version: [2.7, 3.5]
+ python-version: [2.7, 3.6]
steps:
- uses: actions/checkout@v2
-
+ 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.
+ # 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@v1
+ uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: "Upgrade pip on Python 3"
- if: matrix.python-version == '3.5'
+ if: matrix.python-version == '3.6'
run: python -m pip install --upgrade pip
- name: Install requirements
@@ -88,8 +108,8 @@ jobs:
- name: Tests (sanity)
run: tools\windows\run_tests.bat "gitlint\tests\cli\test_cli.py::CLITests::test_lint"
- - name: Tests (ignore test_cli.py)
- run: pytest --ignore gitlint\tests\cli\test_cli.py -rw -s gitlint
+ - name: Tests (ignore cli\*)
+ run: pytest --ignore gitlint\tests\cli -rw -s gitlint
- name: Tests (test_cli.py only - continue-on-error:true)
run: tools\windows\run_tests.bat "gitlint\tests\cli\test_cli.py"
@@ -109,5 +129,9 @@ jobs:
- name: PyLint
run: pylint gitlint qa --rcfile=".pylintrc" -r n
+ # Re-add git version control so we can run gitlint on itself.
+ - name: Re-add git version control to code
+ run: Rename-Item ._git .git
+
- name: Gitlint check
run: gitlint --debug