1- name : Hadolint 
1+ name : Lint 
22
33on :
44  pull_request :
88      - ' **/Dockerfile' 
99      - ' .github/workflows/lint.yml' 
1010
11+ concurrency :
12+   group : ${{ github.head_ref }}-${{ github.workflow }} 
13+   cancel-in-progress : true 
14+ 
1115jobs :
1216  hadolint :
1317    runs-on : ubuntu-24.04 
1620    - 
uses : 
hadolint/[email protected]  1721      with :
1822        recursive : true 
23+   ensure-dockerfiles-up-to-date :
24+     runs-on : ubuntu-24.04 
25+     steps :
26+     - uses : actions/checkout@v4 
27+     - name : Install GHC and Stack 
28+       uses : 
haskell-actions/[email protected]   29+       with :
30+         enable-stack : true 
31+ 
32+     - name : " Cache .stack-work and ~/.stack" 
33+ 34+       with :
35+         path : | 
36+           ~/.stack 
37+           **/.stack-work 
38+ key : ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml') }} 
39+         restore-keys : | 
40+           ${{ runner.os }}-stack- 
41+ 
42+ name : Build dockerfiles generator 
43+       run : | 
44+         pushd generator 
45+         stack setup 
46+         stack build --no-terminal 
47+ name : Ensure Dockerfiles are up-to-date 
48+       run : | 
49+         # Collect the list of Dockerfiles to be built 
50+         mapfile -t dockerfiles < <(find . -type f -name 'Dockerfile' | sort) 
51+         # Generate Dockerfiles using the generate.sh wrapper tool 
52+         for df in "${dockerfiles[@]}"; do 
53+           # Get appropriate YAML data file from the Dockerfile path 
54+           df_dir=$(dirname "${df}") 
55+           df_yaml="${df_dir}.yaml" 
56+           if [ ! -f "${df_yaml}" ]; then 
57+             echo "Error: Missing YAML data file ${df_yaml} for Dockerfile ${df}" 
58+             exit 1 
59+           fi 
60+           echo "Generating ${df}" 
61+           ./generate.sh "${df_yaml}" "${df}.generated" 
62+           # Compare generated Dockerfile with the existing one 
63+           if ! diff -u "${df}" "${df}.generated"; then 
64+               echo "Error: Dockerfile ${df} is out of date. Please regenerate it." 
65+               exit 1 
66+           fi 
67+         done 
0 commit comments