Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile linter #21

Merged
merged 1 commit into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/kubeconform.yml

This file was deleted.

31 changes: 29 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ on:
workflow_call:

jobs:
lint:
name: Lint
rust:
name: Rust
permissions:
contents: read
runs-on: ubuntu-22.04
Expand All @@ -19,3 +19,30 @@ jobs:
uses: Swatinem/[email protected]
- name: Lint
run: make lint
dockerfile:
name: Dockerfile
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint Dockerfile
run: docker run --rm -i hadolint/hadolint:v2.12.1-beta-alpine < Dockerfile
kubernetes:
name: Kubernetes
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
# Deliberately set up Kubeconform before checking out the repository, as we might otherwise get name collisions
# between the kubeconform directory and kubeconform binary (which have the same name).
- name: Setup Kubeconform
run: |
curl -L -O https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
tar -xvf kubeconform-linux-amd64.tar.gz
mv kubeconform /usr/local/bin
- name: Checkout
uses: actions/checkout@v4
- name: Run Kubeconform
run: make kubeconform
8 changes: 1 addition & 7 deletions .github/workflows/main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@ jobs:
lint:
name: Lint
uses: ./.github/workflows/lint.yml
end-to-end:
name: End-to-end
uses: ./.github/workflows/test-end-to-end.yml
kubeconform:
name: Kubeconform
uses: ./.github/workflows/kubeconform.yml
publish:
name: Publish
uses: ./.github/workflows/publish.yml
secrets: inherit
needs: [test, lint, end-to-end, kubeconform]
needs: [test, lint]
with:
version: '${{ github.sha }}'
platforms: 'linux/amd64,linux/arm64'
8 changes: 1 addition & 7 deletions .github/workflows/pr-push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Requests
name: Pull Request

on:
pull_request:
Expand All @@ -10,9 +10,3 @@ jobs:
lint:
name: Lint
uses: ./.github/workflows/lint.yml
end-to-end:
name: End-to-end
uses: ./.github/workflows/test-end-to-end.yml
kubeconform:
name: Kubeconform
uses: ./.github/workflows/kubeconform.yml
8 changes: 1 addition & 7 deletions .github/workflows/tag-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@ jobs:
lint:
name: Lint
uses: ./.github/workflows/lint.yml
end-to-end:
name: End-to-end
uses: ./.github/workflows/test-end-to-end.yml
kubeconform:
name: Kubeconform
uses: ./.github/workflows/kubeconform.yml
publish:
name: Publish
uses: ./.github/workflows/publish.yml
secrets: inherit
needs: [test, lint, end-to-end, kubeconform]
needs: [test, lint]
with:
# https://github.com/orgs/community/discussions/26686#discussioncomment-3396593.
version: '${{ github.ref_name }}'
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/test-end-to-end.yml

This file was deleted.

25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ on:
workflow_call:

jobs:
test:
name: Test
unit:
name: Unit
permissions:
contents: read
runs-on: ubuntu-22.04
Expand All @@ -18,3 +18,24 @@ jobs:
uses: Swatinem/[email protected]
- name: Test
run: make test
end-to-end:
name: End-to-end
strategy:
matrix:
kubernetes-version: [ 'v1.29.7', 'v1.30.6', 'v1.31.0' ]
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Install Minikube
uses: medyagh/[email protected]
with:
start: false
- name: Setup for test
run: END_TO_END_TEST_KUBERNETES_VERSION=${{ matrix.kubernetes-version }} make setup
- name: Run end-to-end tests
run: make test-end-to-end