Skip to content

Add Dockerfiles to build images from UBI9 minimal #14533

Add Dockerfiles to build images from UBI9 minimal

Add Dockerfiles to build images from UBI9 minimal #14533

Workflow file for this run

name: Lint
on:
push:
branches:
- main
pull_request:
branches:
- "**"
defaults:
run:
shell: bash
concurrency:
group: ${{ github.ref_name }}-lint
cancel-in-progress: true
permissions:
contents: read
jobs:
lint:
name: Go Lint
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
directory: [., tests] # we need to run golangci-lint for every module https://github.com/golangci/golangci-lint/issues/828
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Configure GOPROXY
id: goproxy
run: |
if [[ "${{ secrets.ARTIFACTORY_USER }}" == "" ]]; then
GOPROXY_VALUE="direct"
else
GOPROXY_VALUE="https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_DEV_ENDPOINT }}"
fi
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
- name: Setup Golang Environment
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version: stable
- name: Lint Go
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
working-directory: ${{ matrix.directory }}
version: v2.5.0 # renovate: datasource=github-tags depName=golangci/golangci-lint
njs-lint:
name: NJS Lint
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Node.js Environment
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: .nvmrc
- name: Run Prettier on NJS code
id: prettier-run
uses: rutajdash/prettier-cli-action@d42c4325a3b344f3bd4be482bc34de521998d557 # v1.0.2
with:
config_path: ${{ github.workspace }}/internal/controller/nginx/modules/.prettierrc
file_pattern: ${{ github.workspace }}/internal/controller/nginx/modules/**/*.js
prettier_version: 3.3.3 # renovate: datasource=npm depName=prettier
- name: Prettier Output
if: failure()
shell: bash
run: |
echo "The following files are not formatted:"
echo "${{steps.prettier-run.outputs.prettier_output}}"
echo "Run \"make njs-fmt\" locally to format the code"
actionlint:
name: Actionlint
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Lint Actions
uses: reviewdog/action-actionlint@95395aac8c053577d0bc67eb7b74936c660c6f66 # v1.67.0
with:
actionlint_flags: -shellcheck ""
markdown-lint:
name: Markdown Lint
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Lint Markdown
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
with:
config: .markdownlint-cli2.yaml
globs: "**/*.md"
fix: false
chart-lint:
name: Chart Lint
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.x"
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
with:
version: 3.13.0 # renovate: datasource=github-tags depName=helm/chart-testing
- name: Run chart-testing
run: ct lint --print-config --config .ct.yaml
yaml-lint:
name: YAML lint
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Lint YAML
uses: reviewdog/action-yamllint@f01d8a48fd8d89f89895499fca2cff09f9e9e8c0 # v1.21.0