ci: upgrade to super-linter 6 (#952)

This commit is contained in:
Kévin Dunglas
2024-08-04 14:05:54 +02:00
committed by GitHub
parent bcc825a121
commit 6c708be99d
12 changed files with 190 additions and 169 deletions

View File

@@ -16,12 +16,15 @@ on:
- v*.*.* - v*.*.*
workflow_dispatch: workflow_dispatch:
inputs: inputs:
#checkov:skip=CKV_GHA_7
version: version:
description: 'FrankenPHP version' description: 'FrankenPHP version'
required: false required: false
type: string type: string
schedule: schedule:
- cron: '0 4 * * *' - cron: '0 4 * * *'
permissions:
contents: read
env: env:
IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }} IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }}
jobs: jobs:

View File

@@ -7,17 +7,14 @@ on:
push: push:
branches: branches:
- main - main
permissions:
contents: read
packages: read
statuses: write
jobs: jobs:
build: build:
name: Lint Code Base name: Lint Code Base
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write
steps: steps:
- -
name: Checkout Code name: Checkout Code
@@ -26,7 +23,7 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- -
name: Lint Code Base name: Lint Code Base
uses: super-linter/super-linter/slim@v5 uses: super-linter/super-linter/slim@v6.8.0
env: env:
VALIDATE_ALL_CODEBASE: true VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main DEFAULT_BRANCH: main
@@ -36,7 +33,11 @@ jobs:
VALIDATE_CPP: false VALIDATE_CPP: false
VALIDATE_JSCPD: false VALIDATE_JSCPD: false
VALIDATE_GO: false VALIDATE_GO: false
VALIDATE_GO_MODULES: false
VALIDATE_PHP_PHPCS: false VALIDATE_PHP_PHPCS: false
VALIDATE_PHP_PHPSTAN: false VALIDATE_PHP_PHPSTAN: false
VALIDATE_PHP_PSALM: false VALIDATE_PHP_PSALM: false
VALIDATE_TERRAGRUNT: false VALIDATE_TERRAGRUNT: false
# Prettier and StandardJS are incompatible
VALIDATE_JAVASCRIPT_PRETTIER: false
VALIDATE_TYPESCRIPT_PRETTIER: false

View File

@@ -16,12 +16,15 @@ on:
- v*.*.* - v*.*.*
workflow_dispatch: workflow_dispatch:
inputs: inputs:
#checkov:skip=CKV_GHA_7
version: version:
description: 'FrankenPHP version' description: 'FrankenPHP version'
required: false required: false
type: string type: string
schedule: schedule:
- cron: '0 0 * * *' - cron: '0 0 * * *'
permissions:
contents: write
env: env:
IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }} IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }}
jobs: jobs:

View File

@@ -11,6 +11,8 @@ on:
- main - main
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
permissions:
contents: read
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@@ -1,4 +1,7 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
#checkov:skip=CKV_DOCKER_7
FROM php-base AS common FROM php-base AS common
WORKDIR /app WORKDIR /app

View File

@@ -1,4 +1,7 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
#checkov:skip=CKV_DOCKER_7
FROM php-base AS common FROM php-base AS common
ARG TARGETARCH ARG TARGETARCH

View File

@@ -3,7 +3,7 @@
set -o errexit set -o errexit
set -x set -x
if ! type "git" > /dev/null 2>&1; then if ! type "git" >/dev/null 2>&1; then
echo "The \"git\" command must be installed." echo "The \"git\" command must be installed."
exit 1 exit 1
fi fi
@@ -16,7 +16,7 @@ if [ "${os}" = "darwin" ]; then
md5binary="md5 -q" md5binary="md5 -q"
fi fi
if [ "${os}" = "linux" ] && ! type "cmake" > /dev/null 2>&1; then if [ "${os}" = "linux" ] && ! type "cmake" >/dev/null 2>&1; then
echo "The \"cmake\" command must be installed." echo "The \"cmake\" command must be installed."
exit 1 exit 1
fi fi
@@ -87,14 +87,14 @@ else
cd static-php-cli/ cd static-php-cli/
fi fi
if type "brew" > /dev/null 2>&1; then if type "brew" >/dev/null 2>&1; then
if ! type "composer" > /dev/null; then if ! type "composer" >/dev/null; then
packages="composer" packages="composer"
fi fi
if ! type "go" > /dev/null; then if ! type "go" >/dev/null; then
packages="${packages} go" packages="${packages} go"
fi fi
if [ -n "${RELEASE}" ] && ! type "gh" > /dev/null 2>&1; then if [ -n "${RELEASE}" ] && ! type "gh" >/dev/null 2>&1; then
packages="${packages} gh" packages="${packages} gh"
fi fi
@@ -167,7 +167,7 @@ if [ "${os}" = "linux" ]; then
git checkout "$(git describe --tags "$(git rev-list --tags --max-count=1 || true)" || true)" git checkout "$(git describe --tags "$(git rev-list --tags --max-count=1 || true)" || true)"
curl -f -L --retry 5 https://raw.githubusercontent.com/tweag/rust-alpine-mimalloc/b26002b49d466a295ea8b50828cb7520a71a872a/mimalloc.diff -o mimalloc.diff curl -f -L --retry 5 https://raw.githubusercontent.com/tweag/rust-alpine-mimalloc/b26002b49d466a295ea8b50828cb7520a71a872a/mimalloc.diff -o mimalloc.diff
patch -p1 < mimalloc.diff patch -p1 <mimalloc.diff
mkdir -p out/ mkdir -p out/
cd out/ cd out/
@@ -198,8 +198,7 @@ if [ "${os}" = "linux" ]; then
fi fi
# Patch musl library to use mimalloc # Patch musl library to use mimalloc
for libc_path in "/usr/local/musl/lib/libc.a" "/usr/local/musl/$(uname -m)-linux-musl/lib/libc.a" "/usr/lib/libc.a" for libc_path in "/usr/local/musl/lib/libc.a" "/usr/local/musl/$(uname -m)-linux-musl/lib/libc.a" "/usr/lib/libc.a"; do
do
if [ ! -f "${libc_path}" ] || [ -f "${libc_path}.unpatched" ]; then if [ ! -f "${libc_path}" ] || [ -f "${libc_path}.unpatched" ]; then
continue continue
fi fi
@@ -229,7 +228,7 @@ cd ../
# Embed PHP app, if any # Embed PHP app, if any
if [ -n "${EMBED}" ] && [ -d "${EMBED}" ]; then if [ -n "${EMBED}" ] && [ -d "${EMBED}" ]; then
tar -cf app.tar -C "${EMBED}" . tar -cf app.tar -C "${EMBED}" .
${md5binary} app.tar | awk '{printf $1}' > app_checksum.txt ${md5binary} app.tar | awk '{printf $1}' >app_checksum.txt
fi fi
cd caddy/frankenphp/ cd caddy/frankenphp/
@@ -242,7 +241,7 @@ if [ -d "${EMBED}" ]; then
truncate -s 0 app_checksum.txt truncate -s 0 app_checksum.txt
fi fi
if type "upx" > /dev/null 2>&1 && [ -z "${DEBUG_SYMBOLS}" ] && [ -z "${NO_COMPRESS}" ]; then if type "upx" >/dev/null 2>&1 && [ -z "${DEBUG_SYMBOLS}" ] && [ -z "${NO_COMPRESS}" ]; then
upx --best "dist/${bin}" upx --best "dist/${bin}"
fi fi

View File

@@ -1,4 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
FROM golang:1.22-alpine FROM golang:1.22-alpine
ENV CFLAGS="-ggdb3" ENV CFLAGS="-ggdb3"

View File

@@ -1,4 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
FROM golang:1.22 FROM golang:1.22
ENV CFLAGS="-ggdb3" ENV CFLAGS="-ggdb3"

View File

@@ -9,12 +9,12 @@ set -o errtrace
set -o pipefail set -o pipefail
set -o xtrace set -o xtrace
if ! type "git" > /dev/null; then if ! type "git" >/dev/null; then
echo "The \"git\" command must be installed." echo "The \"git\" command must be installed."
exit 1 exit 1
fi fi
if ! type "gh" > /dev/null; then if ! type "gh" >/dev/null; then
echo "The \"gh\" command must be installed." echo "The \"gh\" command must be installed."
exit 1 exit 1
fi fi
@@ -44,6 +44,6 @@ git tag -s -m "Version $1" "caddy/v$1"
git push --follow-tags git push --follow-tags
tags=$(git tag --list --sort=-version:refname 'v*') tags=$(git tag --list --sort=-version:refname 'v*')
previous_tag=$(awk 'NR==2 {print;exit}' <<< "${tags}") previous_tag=$(awk 'NR==2 {print;exit}' <<<"${tags}")
gh release create --draft --generate-notes --latest --notes-start-tag "${previous_tag}" --verify-tag "v$1" gh release create --draft --generate-notes --latest --notes-start-tag "${previous_tag}" --verify-tag "v$1"

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
for ((i = 0 ; i < 100 ; i++)); do for ((i = 0; i < 100; i++)); do
curl --no-progress-meter -o /dev/null http://localhost:2019/config/apps/frankenphp -: --no-progress-meter -o /dev/null -H 'Cache-Control: must-revalidate' -H 'Content-Type: application/json' --data-binary '{"workers":[{"file_name":"./index.php"}]}' -X PATCH http://localhost:2019/config/apps/frankenphp curl --no-progress-meter -o /dev/null http://localhost:2019/config/apps/frankenphp -: --no-progress-meter -o /dev/null -H 'Cache-Control: must-revalidate' -H 'Content-Type: application/json' --data-binary '{"workers":[{"file_name":"./index.php"}]}' -X PATCH http://localhost:2019/config/apps/frankenphp
done done

View File

@@ -1,4 +1,7 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
#checkov:skip=CKV_DOCKER_2
#checkov:skip=CKV_DOCKER_3
#checkov:skip=CKV_DOCKER_7
FROM golang-base FROM golang-base
ARG TARGETARCH ARG TARGETARCH