| 1 | name: Test Release |
| 2 | run-name: "Test Release (${{ inputs.gitlint_version }}, pypi_source=${{ inputs.pypi_source }}, repo_test_ref=${{ inputs.repo_test_ref }})" |
| 3 | on: |
| 4 | workflow_call: |
| 5 | inputs: |
| 6 | gitlint_version: |
| 7 | description: "Gitlint version to test" |
| 8 | required: true |
| 9 | default: "0.18.0" |
| 10 | type: string |
| 11 | pypi_source: |
| 12 | description: "PyPI repository to use" |
| 13 | required: true |
| 14 | type: string |
| 15 | repo_test_ref: |
| 16 | description: "Git reference to checkout for integration tests" |
| 17 | default: "main" |
| 18 | type: string |
| 19 | workflow_dispatch: |
| 20 | inputs: |
| 21 | gitlint_version: |
| 22 | description: "Gitlint version to test" |
| 23 | required: true |
| 24 | default: "0.18.0" |
| 25 | pypi_source: |
| 26 | description: "PyPI repository to use" |
| 27 | required: true |
| 28 | type: choice |
| 29 | options: |
| 30 | - "pypi.org" |
| 31 | - "test.pypi.org" |
| 32 | default: "pypi.org" |
| 33 | repo_test_ref: |
| 34 | description: "Git reference to checkout for integration tests" |
| 35 | default: "main" |
| 36 | |
| 37 | jobs: |
| 38 | test-release: |
| 39 | timeout-minutes: 10 |
| 40 | runs-on: "ubuntu-latest" |
| 41 | strategy: |
| 42 | matrix: |
| 43 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy-3.9] |
| 44 | os: ["macos-latest", "ubuntu-latest", "windows-latest"] |
| 45 | steps: |
| 46 | - name: Setup python |
| 47 | uses: actions/[email protected] |
| 48 | with: |
| 49 | python-version: ${{ matrix.python-version }} |
| 50 | |
| 51 | - name: Install Hatch |
| 52 | run: python -m pip install hatch==1.6.3 |
| 53 | |
| 54 | - name: Install gitlint |
| 55 | run: | |
| 56 | python -m pip install gitlint==${{ inputs.gitlint_version }} |
| 57 | if: inputs.pypi_source == 'pypi.org' |
| 58 | |
| 59 | - name: Install gitlint (test.pypi.org) |
| 60 | run: | |
| 61 | pip install --no-cache-dir -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple gitlint==${{ inputs.gitlint_version }} |
| 62 | if: inputs.pypi_source == 'test.pypi.org' |
| 63 | |
| 64 | - name: gitlint --version |
| 65 | run: | |
| 66 | gitlint --version |
| 67 | [ "$(gitlint --version)" == "gitlint, version ${{ inputs.gitlint_version }}" ] |
| 68 | |
| 69 | - uses: actions/[email protected] |
| 70 | with: |
| 71 | ref: ${{ inputs.repo_test_ref }} |
| 72 | |
| 73 | - name: Integration tests (default -> GITLINT_USE_SH_LIB=1) |
| 74 | run: | |
| 75 | hatch run qa:integration-tests |
| 76 | if: matrix.os != 'windows-latest' |
| 77 | |
| 78 | - name: Integration tests (GITLINT_USE_SH_LIB=1) |
| 79 | run: | |
| 80 | hatch run qa:integration-tests |
| 81 | env: |
| 82 | GITLINT_USE_SH_LIB: 1 |
| 83 | if: matrix.os != 'windows-latest' |
| 84 | |
| 85 | - name: Integration tests (GITLINT_QA_USE_SH_LIB=0) |
| 86 | run: | |
| 87 | hatch run qa:integration-tests -k "not(test_commit_hook_continue or test_commit_hook_abort or test_commit_hook_edit)" qa |
| 88 | env: |
| 89 | GITLINT_QA_USE_SH_LIB: 0 |
| 90 | if: matrix.os != 'windows-latest' |
| 91 | |
| 92 | - name: Integration tests (Windows) |
| 93 | run: | |
| 94 | 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 |
| 95 | if: matrix.os == 'windows-latest' |