diff options
author | Joris Roovers <joris.roovers@gmail.com> | 2023-03-21 11:13:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 11:13:45 +0100 |
commit | dfa4af306b203c753194c97ab55a14f946b42855 (patch) | |
tree | a2cdd7636511209ad7216434559ec7555a96dfc8 | |
parent | acc9d9de6369b76d22cb4167029d2035e8730b98 (diff) |
GHA: Test Docker workflow (#473)
Allows for post-release testing of docker images.
-rw-r--r-- | .github/workflows/test-docker.yml | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml new file mode 100644 index 0000000..073c2f2 --- /dev/null +++ b/.github/workflows/test-docker.yml @@ -0,0 +1,46 @@ +name: Test Docker +run-name: "Test Docker (docker_tag=${{ inputs.docker_tag }}, gitlint_version=${{ inputs.gitlint_version }})" + +on: + workflow_call: + inputs: + docker_tag: + description: "Docker tag to pull and run (latest, latest_dev, 0.15.0, etc)" + required: true + default: "latest" + gitlint_version: + description: "Expected gitlint version (0.15.0, etc)" + required: true + default: "0.15.0" + workflow_dispatch: + inputs: + docker_tag: + description: "Docker tag to pull and run (latest, latest_dev, 0.15.0, etc)" + required: true + default: "latest" + gitlint_version: + description: "Expected gitlint version (0.15.0, etc)" + required: true + default: "0.15.0" + +jobs: + test-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Run gitlint --version using docker + run: | + DOCKER_TAG=${{ github.event.inputs.docker_tag }} + GITLINT_VERSION=${{ github.event.inputs.gitlint_version }} + + GITLINT_CURRENT_VERSION=$(docker run --rm -v $(pwd):/repo jorisroovers/gitlint:${DOCKER_TAG} --version) + echo "gitlint version: ${GITLINT_CURRENT_VERSION}" + + if [[ ! "${GITLINT_CURRENT_VERSION}" =~ "${GITLINT_VERSION}" ]]; then + echo "Error: Expected version ${GITLINT_VERSION} != ${GITLINT_CURRENT_VERSION}" + exit 1 + fi |