Skip to content
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
47 changes: 23 additions & 24 deletions .github/workflows/chart-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Chart CI

on:
workflow_call:
inputs:
Expand All @@ -25,12 +24,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v4.3.1
uses: azure/setup-helm@v5
with:
version: v3.14.4

Expand All @@ -52,22 +51,22 @@ jobs:
helm dependency build ${{ inputs.chart-dir }}

- name: Generate values schema json
uses: losisin/helm-values-schema-json-action@v1.5.3
uses: losisin/helm-values-schema-json-action@v2.5.0
with:
input: ${{ inputs.chart-dir }}/values.yaml
values: ${{ inputs.chart-values }}
output: ${{ inputs.chart-dir }}/values.schema.json

- name: Helm-docs
uses: losisin/helm-docs-github-action@v1.3.3
uses: losisin/helm-docs-github-action@v1.8.0
with:
chart-search-root: ${{ inputs.chart-dir }}
values-file: ${{ inputs.chart-dir }}/values.yaml
values-file: ${{ inputs.chart-values }}
output-file: ${{ inputs.chart-dir }}/README.md
template-files: ${{ inputs.chart-dir }}/README.md.gotpl
sort-values-order: file

- name: Upload packaged Chart
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: packaged-chart
path: ${{ inputs.chart-dir }}
Expand All @@ -81,21 +80,21 @@ jobs:
needs: helm-build-chart
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Download packaged Chart
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: packaged-chart
path: ${{ inputs.chart-dir }}

- name: Set up Helm
uses: azure/setup-helm@v4.3.1
uses: azure/setup-helm@v5

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
uses: helm/chart-testing-action@v2.8.0

- name: Run ct lint
run: |
Expand All @@ -110,13 +109,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download packaged Chart
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: packaged-chart
path: ${{ inputs.chart-dir }}

- name: Set up Helm
uses: azure/setup-helm@v4.3.1
uses: azure/setup-helm@v5
with:
version: v3.14.4

Expand All @@ -141,7 +140,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download packaged Chart
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: packaged-chart
path: ${{ inputs.chart-dir }}
Expand All @@ -150,7 +149,7 @@ jobs:
run: |
mkdir -p .local/bin
curl -s https://api.github.com/repos/FairwindsOps/polaris/releases/latest | \
jq '.assets[] | select(.name=="polaris_linux_amd64.tar.gz")'.browser_download_url | \
jq '.assets[] | select(.name | endswith("linux_amd64.tar.gz"))'.browser_download_url | \
xargs curl -s -L | \
tar xvz -C .local/bin polaris
echo "$PWD/.local/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -179,13 +178,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download packaged Chart
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: packaged-chart
path: ${{ inputs.chart-dir }}

- name: Build Trivy Vulnerability report
uses: aquasecurity/trivy-action@v0.35.0
uses: aquasecurity/trivy-action@v0.36.0
env:
TRIVY_HELM_KUBE_VERSION: ${{ inputs.kubernetes-version }}
TRIVY_HELM_SET_FILE: ${{ inputs.chart-values }}
Expand All @@ -203,7 +202,7 @@ jobs:
sarif_file: 'trivy-vuln-results.sarif'

- name: Run Trivy Vulnerability scan
uses: aquasecurity/trivy-action@v0.35.0
uses: aquasecurity/trivy-action@v0.36.0
env:
TRIVY_HELM_KUBE_VERSION: ${{ inputs.kubernetes-version }}
TRIVY_HELM_SET_FILE: ${{ inputs.chart-values }}
Expand All @@ -225,23 +224,23 @@ jobs:
- trivy
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Download packaged Chart
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: packaged-chart
path: ${{ inputs.chart-dir }}

- name: Set up Helm
uses: azure/setup-helm@v4.3.1
uses: azure/setup-helm@v5
with:
version: v3.14.4

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
uses: helm/chart-testing-action@v2.8.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down Expand Up @@ -272,7 +271,7 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand Down
83 changes: 81 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: CI

# Controls when the workflow will run
Expand All @@ -12,10 +11,23 @@ on:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
environment:
description: 'Environment to run tests against'
type: environment
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand All @@ -34,3 +46,70 @@ jobs:
level: warning
line-length: disable # don't bother me with this rule
comments-indentation: disable # don't bother me with this rule

tests-container-ci-with-dockle-accept:
needs: [build]
uses: "./.github/workflows/container-ci.yml"
with:
dockerfile-path: "./test/container/Dockerfile"
hadolint-ignore: "DL3008,DL3016"
image-name: aphp-busybox
image-custom-tag: test-with-dockle-accept
dockle-ignore: "CIS-DI-0010,DKL-DI-0001,CIS-DI-0001"
dockle-accept-file:
dockle-accept-key: |
PHP_SHA256,
PHPIZE_DEPS,
PHP_INI_DIR,
extra-build-args: |
KEY_TEST_1=value_test_1
KEY_TEST_2="value test 2"
trivy-ignore-vuln-ids: |
CVE-2024-21508
trivy-ignore-license-ids: |
WTFPL
dry-run: true

tests-container-ci-without-dockle-accept:
needs: [build]
uses: "./.github/workflows/container-ci.yml"
with:
dockerfile-path: "./test/container/Dockerfile"
image-name: aphp-busybox
image-custom-tag: test-without-dockle-accept
dockle-ignore: "CIS-DI-0010,DKL-DI-0001,CIS-DI-0001"
extra-build-args: |
KEY_TEST_1=value_test_1
KEY_TEST_2="value test 2"
trivy-ignore-vuln-ids: |
CVE-2024-21508
trivy-ignore-license-ids: |
WTFPL
dry-run: true

tests-container-ci-without-dockle-accept-without-trivyignore:
needs: build
uses: "./.github/workflows/container-ci.yml"
with:
dockerfile-path: "./test/container/Dockerfile"
image-name: aphp-busybox
image-custom-tag: test-without-dockle-accept-without-trivyignore
dockle-ignore: "CIS-DI-0010,DKL-DI-0001,CIS-DI-0001"
extra-build-args: |
KEY_TEST_1=value_test_1
KEY_TEST_2="value test 2"
dry-run: true


clean-up:
needs: [tests-container-ci-without-dockle-accept-without-trivyignore, tests-container-ci-without-dockle-accept, tests-container-ci-with-dockle-accept]
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: End Test Workflow
run: |
docker images



# tests-container-chart:
Loading
Loading