diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:10 +0000 |
commit | a85f3954a8fe112640c2c35da3228be29b17c97c (patch) | |
tree | 7ee43f79639ee53903e7ca389e548974e1497c3a /.github | |
parent | Initial commit. (diff) | |
download | gitlint-upstream.tar.xz gitlint-upstream.zip |
Adding upstream version 0.18.0.upstream/0.18.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github')
-rw-r--r-- | .github/ISSUE_TEMPLATE/issue-template.md | 22 | ||||
-rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md | 13 | ||||
-rw-r--r-- | .github/dependabot.yml | 14 | ||||
-rw-r--r-- | .github/workflows/checks.yml | 155 |
4 files changed, 204 insertions, 0 deletions
diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md new file mode 100644 index 0000000..c178614 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -0,0 +1,22 @@ +--- +name: Issue template +about: Bug reports, feature requests +title: '' +labels: '' +assignees: '' + +--- + +<!--- THIS IS A COMMENT BLOCK, REMOVE IT BEFORE SUBMITTING YOUR ISSUE + +Thank you for your interest in gitlint and taking the time to open a bug report! + +A few quick notes: + +- If you can, please include the output of `gitlint --debug` as this includes useful debugging info. +- 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 read all bug reports as soon as they come in - I just tend to only "work" on gitlint a few times a year. +- If you're looking to contribute code to gitlint, please start here: http://jorisroovers.github.io/gitlint/contributing/ + +--> + +Enter your issue details here 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/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7c33438 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: docker + directory: / + schedule: + interval: daily + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + - package-ecosystem: pip + directory: / + schedule: + interval: daily diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..39b3782 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,155 @@ +name: Tests and Checks + +on: [push, pull_request] + +jobs: + checks: + runs-on: "ubuntu-latest" + strategy: + matrix: + 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@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. + # 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@v4.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Install requirements + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: Unit Tests + run: ./run_tests.sh + + # Coveralls integration doesn't properly work at this point, also see below + # - name: Coveralls + # env: + # 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 + + # 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: 1 + run: ./run_tests.sh -i + + - name: Code formatting (black) + run: ./run_tests.sh -f + + - name: PyLint + run: ./run_tests.sh -l + + - name: Build tests + run: ./run_tests.sh --build + + # Coveralls GH Action currently doesn't support current non-LCOV reporting format + # For now, still using Travis for unit test coverage reporting + # https://github.com/coverallsapp/github-action/issues/30 + # - name: Coveralls + # uses: coverallsapp/github-action@master + # 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 + + # Run gitlint. Skip during PR runs, since PR commit messages are transient and usually full of gitlint violations. + # PRs get squashed and get a proper commit message during merge. + - name: Gitlint check + run: ./run_tests.sh -g --debug + if: ${{ github.event_name != 'pull_request' }} + + windows-checks: + runs-on: windows-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - 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. + # 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@v4.2.0 + with: + python-version: ${{ matrix.python-version }} + + - name: "Upgrade pip on Python 3" + if: matrix.python-version == '3.10' + run: python -m pip install --upgrade pip + + - name: Install requirements + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: gitlint --version + run: gitlint --version + + - name: Tests (sanity) + run: tools\windows\run_tests.bat "gitlint-core\gitlint\tests\cli\test_cli.py::CLITests::test_lint" + + - name: Tests (ignore cli\*) + run: pytest --ignore gitlint-core\gitlint\tests\cli -rw -s gitlint-core + + - name: Tests (test_cli.py only - continue-on-error:true) + run: tools\windows\run_tests.bat "gitlint-core\gitlint\tests\cli\test_cli.py" + continue-on-error: true # Known to fail at this point + + - name: Tests (all - continue-on-error:true) + run: tools\windows\run_tests.bat + continue-on-error: true # Known to fail at this point + + - name: Integration tests (continue-on-error:true) + run: pytest -rw -s qa + continue-on-error: true # Known to fail at this point + + - name: Code formatting (black) + run: black . + + - name: PyLint + run: pylint gitlint-core\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 + + # Run gitlint. Skip during PR runs, since PR commit messages are transient and usually full of gitlint violations. + # PRs get squashed and get a proper commit message during merge. + - name: Gitlint check + run: gitlint --debug + if: ${{ github.event_name != 'pull_request' }} |