-
-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (38 loc) Β· 1.38 KB
/
Copy pathdocker-validate.yml
File metadata and controls
48 lines (38 loc) Β· 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
name: Docker Validate
on:
workflow_call:
inputs:
simple-matrix:
description: "Simple JSON array of sub-project names"
required: true
type: string
concurrency:
group: docker-validate-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.13"
permissions:
contents: read
jobs:
validate-dockerfiles:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
sub-project: ${{ fromJson(inputs.simple-matrix) }}
steps:
- name: π Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: π§ Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: π Validate Dockerfile with hadolint
uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
with:
dockerfile: ${{ matrix.sub-project }}/Dockerfile
failure-threshold: error
- name: π³ Test Docker build for ${{ matrix.sub-project }}
run: |
echo "π¨ Testing build for ${{ matrix.sub-project }}..."
docker build --build-arg PYTHON_VERSION=${{ env.PYTHON_VERSION }} -f ${{ matrix.sub-project }}/Dockerfile . --target builder
echo "β
${{ matrix.sub-project }} builder stage built successfully"