Skip to content

Commit

Permalink
GHA: Test Docker workflow
Browse files Browse the repository at this point in the history
Allows for post-release testing of docker images.
  • Loading branch information
jorisroovers committed Mar 21, 2023
1 parent acc9d9d commit fc72e49
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
@@ -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:-latest} --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

0 comments on commit fc72e49

Please sign in to comment.