summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoris Roovers <joris.roovers@gmail.com>2023-01-17 12:32:12 +0100
committerGitHub <noreply@github.com>2023-01-17 12:32:12 +0100
commit09d8965da2d0fa865221a27ac1e76a29b3e6ff37 (patch)
tree2a49571b0880d0a563fe32dc205598b97af3be15
parent7319247bef967c7b28468f0e892bcf90ee686ae3 (diff)
GHA: Remove duplicate windows config (#414)
Windows testing now also happens on all supported Python versions.
-rw-r--r--.github/workflows/checks.yml94
1 files changed, 17 insertions, 77 deletions
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index b7e1d6f..6bbf79c 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy-3.9]
- os: ["macos-latest", "ubuntu-latest"]
+ os: ["macos-latest", "ubuntu-latest", "windows-latest"]
steps:
- uses: actions/checkout@v3.3.0
with:
@@ -39,22 +39,33 @@ jobs:
- name: Code linting (ruff)
run: hatch run test:lint
- - name: Integration tests
+ - name: Install local gitlint for integration tests
run: |
hatch run qa:install-local
+
+ - name: Integration tests (default -> GITLINT_USE_SH_LIB=1)
+ run: |
hatch run qa:integration-tests
+ if: matrix.os != 'windows-latest'
- name: Integration tests (GITLINT_USE_SH_LIB=1)
run: |
hatch run qa:integration-tests
env:
GITLINT_USE_SH_LIB: 1
+ if: matrix.os != 'windows-latest'
- name: Integration tests (GITLINT_QA_USE_SH_LIB=0)
run: |
hatch run qa:integration-tests -k "not(test_commit_hook_continue or test_commit_hook_abort or test_commit_hook_edit)" qa
env:
GITLINT_QA_USE_SH_LIB: 0
+ if: matrix.os != 'windows-latest'
+
+ - name: Integration tests (Windows)
+ run: |
+ hatch run qa:integration-tests -k "not (test_commit_hook_continue or test_commit_hook_abort or test_commit_hook_edit or test_lint_staged_stdin or test_stdin_file or test_stdin_pipe_empty)" qa
+ if: matrix.os == 'windows-latest'
- name: Build test (gitlint)
run: |
@@ -70,12 +81,11 @@ jobs:
- name: Docs build (mkdocs)
run: hatch run docs:build
- - name: gitlint --version
- run: hatch run dev:gitlint --version
-
- - name: Hatch run gitlint
+ # 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 --debug
run: hatch run dev:gitlint --debug
- continue-on-error: true
+ continue-on-error: ${{ github.event_name == 'pull_request' }} # Don't enforce gitlint in PRs
# Coveralls integration doesn't properly work at this point, also see below
# - name: Coveralls
@@ -94,81 +104,11 @@ jobs:
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- # 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: hatch run dev:gitlint --debug
- if: ${{ github.event_name != 'pull_request' }}
-
- windows-checks:
- runs-on: windows-latest
- strategy:
- matrix:
- python-version: ["3.10"]
- steps:
- - uses: actions/checkout@v3.3.0
- with:
- ref: ${{ github.event.pull_request.head.sha }} # Checkout pull request HEAD commit instead of merge commit
-
- - name: Setup python
- uses: actions/setup-python@v4.5.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 Hatch
- run: python -m pip install hatch==1.6.3
-
- - name: Unit Tests
- run: hatch run test:unit-tests
-
- - name: Code formatting (black)
- run: hatch run test:format
-
- - name: Code linting (ruff)
- run: hatch run test:lint
-
- - name: Integration tests
- run: |
- hatch run qa:install-local
- hatch run qa:integration-tests -k "not (test_commit_hook_continue or test_commit_hook_abort or test_commit_hook_edit or test_lint_staged_stdin or test_stdin_file or test_stdin_pipe_empty)" qa
-
- - name: Build test (gitlint)
- run: |
- hatch build
- hatch clean
-
- - name: Build test (gitlint-core)
- run: |
- hatch build
- hatch clean
- working-directory: ./gitlint-core
-
- - name: Docs build (mkdocs)
- run: hatch run docs:build
-
- - name: Hatch run gitlint
- run: hatch run gitlint --debug
- continue-on-error: true
-
- - name: gitlint --version
- run: hatch run dev:gitlint --version
-
- # 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: hatch run dev:gitlint --debug
- if: ${{ github.event_name != 'pull_request' }}
-
check: # This job does nothing and is only used for the branch protection
if: always() # Ref: https://github.com/marketplace/actions/alls-green#why
needs:
- checks
- - windows-checks
runs-on: ubuntu-latest