fix: don't download hadolint twice #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test-E2E | |
on: | |
pull_request: | |
paths: | |
- "**.sh" | |
- "test/**" | |
- "action.yml" | |
- ".github/workflows/test-e2e.yml" | |
jobs: | |
gh-action-default: | |
name: Action validates dockerfiles | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
dockerfile: test/fixtures/Dockerfile-valid | |
gh-action-version: | |
name: Action supports custom version | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
id: check | |
with: | |
dockerfile: test/fixtures/Dockerfile-valid | |
version: 2.9.0 | |
- name: check hadolint version | |
run: | | |
if [[ ! "${{ steps.check.outputs.hadolint_version }}" == "2.9.0-no-git" ]]; then | |
echo "::error::Version mismatch: \"${{ steps.check.outputs.hadolint_version }}\" does not equal \"2.9.0-no-git\"" | |
exit 1 | |
fi | |
gh-action-glob: | |
name: Action supports glob expansion | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./ | |
with: | |
dockerfile: "test/**/Dockerfile-glob-*" | |
annotate: false | |
# https://github.com/jbergstroem/hadolint-gh-action/issues/134 | |
gh-action-multtiple-invocations: | |
name: Action supports multiple invocations in a job | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# Download and run default version | |
- uses: ./ | |
with: | |
dockerfile: test/fixtures/Dockerfile-valid | |
# Download and run custom version | |
- uses: ./ | |
with: | |
dockerfile: test/fixtures/Dockerfile-valid | |
version: 2.11.0 | |
# Redownload if binary is broken | |
- run: chmod -x /usr/local/bin/hadolint | |
- uses: ./ | |
with: | |
dockerfile: test/fixtures/Dockerfile-valid | |
version: 2.11.0 | |
# Download and run default version again | |
- uses: ./ | |
with: | |
dockerfile: test/fixtures/Dockerfile-valid |