Skip to content

Commit

Permalink
Add dockerfile linter in CI (#2)
Browse files Browse the repository at this point in the history
Add dockerfile linter in CI

Had to add two steps for neuron and neuronx.
Hadolint-action supports multiple Dockerfiles by pattern but seems not
arbitrary two names.
Using pattern "Dockerfile.*" will include cve allowlists and they cannot
be excluded.

Only fail on error for now. Can refactor to remove warning and info
later.

Signed-off-by: Ziwen Ning <[email protected]>
  • Loading branch information
ningziwen committed Jan 10, 2024
1 parent 52c7c9b commit bfdb65c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
permissions:
id-token: write
contents: write

jobs:
dockerfile-linter:
runs-on: ubuntu-latest
env:
HADOLINT_RECURSIVE: "true"
steps:
- uses: actions/checkout@v3
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile.neuron
recursive: true
failure-threshold: error # TODO: enable more linter rules other than error.
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile.neuronx
recursive: true
failure-threshold: error

0 comments on commit bfdb65c

Please sign in to comment.