Skip to content

Commit fd9838b

Browse files
authored
add Dockerfile linter (#21)
1 parent 7a93fb4 commit fd9838b

File tree

7 files changed

+55
-71
lines changed

7 files changed

+55
-71
lines changed

.github/workflows/kubeconform.yml

-21
This file was deleted.

.github/workflows/lint.yml

+29-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ on:
22
workflow_call:
33

44
jobs:
5-
lint:
6-
name: Lint
5+
rust:
6+
name: Rust
77
permissions:
88
contents: read
99
runs-on: ubuntu-22.04
@@ -19,3 +19,30 @@ jobs:
1919
uses: Swatinem/rust-cache@v2.7.5
2020
- name: Lint
2121
run: make lint
22+
dockerfile:
23+
name: Dockerfile
24+
permissions:
25+
contents: read
26+
runs-on: ubuntu-22.04
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- name: Lint Dockerfile
31+
run: docker run --rm -i hadolint/hadolint:v2.12.1-beta-alpine < Dockerfile
32+
kubernetes:
33+
name: Kubernetes
34+
permissions:
35+
contents: read
36+
runs-on: ubuntu-22.04
37+
steps:
38+
# Deliberately set up Kubeconform before checking out the repository, as we might otherwise get name collisions
39+
# between the kubeconform directory and kubeconform binary (which have the same name).
40+
- name: Setup Kubeconform
41+
run: |
42+
curl -L -O https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
43+
tar -xvf kubeconform-linux-amd64.tar.gz
44+
mv kubeconform /usr/local/bin
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
- name: Run Kubeconform
48+
run: make kubeconform

.github/workflows/main-push.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@ jobs:
1111
lint:
1212
name: Lint
1313
uses: ./.github/workflows/lint.yml
14-
end-to-end:
15-
name: End-to-end
16-
uses: ./.github/workflows/test-end-to-end.yml
17-
kubeconform:
18-
name: Kubeconform
19-
uses: ./.github/workflows/kubeconform.yml
2014
publish:
2115
name: Publish
2216
uses: ./.github/workflows/publish.yml
2317
secrets: inherit
24-
needs: [test, lint, end-to-end, kubeconform]
18+
needs: [test, lint]
2519
with:
2620
version: '${{ github.sha }}'
2721
platforms: 'linux/amd64,linux/arm64'

.github/workflows/pr-push.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pull Requests
1+
name: Pull Request
22

33
on:
44
pull_request:
@@ -10,9 +10,3 @@ jobs:
1010
lint:
1111
name: Lint
1212
uses: ./.github/workflows/lint.yml
13-
end-to-end:
14-
name: End-to-end
15-
uses: ./.github/workflows/test-end-to-end.yml
16-
kubeconform:
17-
name: Kubeconform
18-
uses: ./.github/workflows/kubeconform.yml

.github/workflows/tag-push.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,11 @@ jobs:
1212
lint:
1313
name: Lint
1414
uses: ./.github/workflows/lint.yml
15-
end-to-end:
16-
name: End-to-end
17-
uses: ./.github/workflows/test-end-to-end.yml
18-
kubeconform:
19-
name: Kubeconform
20-
uses: ./.github/workflows/kubeconform.yml
2115
publish:
2216
name: Publish
2317
uses: ./.github/workflows/publish.yml
2418
secrets: inherit
25-
needs: [test, lint, end-to-end, kubeconform]
19+
needs: [test, lint]
2620
with:
2721
# https://github.com/orgs/community/discussions/26686#discussioncomment-3396593.
2822
version: '${{ github.ref_name }}'

.github/workflows/test-end-to-end.yml

-25
This file was deleted.

.github/workflows/test.yml

+23-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ on:
22
workflow_call:
33

44
jobs:
5-
test:
6-
name: Test
5+
unit:
6+
name: Unit
77
permissions:
88
contents: read
99
runs-on: ubuntu-22.04
@@ -18,3 +18,24 @@ jobs:
1818
uses: Swatinem/rust-cache@v2.7.5
1919
- name: Test
2020
run: make test
21+
end-to-end:
22+
name: End-to-end
23+
strategy:
24+
matrix:
25+
kubernetes-version: [ 'v1.29.7', 'v1.30.6', 'v1.31.0' ]
26+
permissions:
27+
contents: read
28+
runs-on: ubuntu-22.04
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
- name: Set up Docker
33+
uses: docker/setup-buildx-action@v3
34+
- name: Install Minikube
35+
uses: medyagh/setup-minikube@v0.0.18
36+
with:
37+
start: false
38+
- name: Setup for test
39+
run: END_TO_END_TEST_KUBERNETES_VERSION=${{ matrix.kubernetes-version }} make setup
40+
- name: Run end-to-end tests
41+
run: make test-end-to-end

0 commit comments

Comments
 (0)