Skip to content

Commit

Permalink
ci: bump super-linter from 6.8 to 7.2.1 and fix codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceAmstoutz committed Dec 20, 2024
1 parent 57bc548 commit 77b60f5
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 213 deletions.
12 changes: 4 additions & 8 deletions .github/actions/watcher/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ description: Install e-dant/watcher
runs:
using: composite
steps:
-
name: Determine e-dant/watcher version
- name: Determine e-dant/watcher version
id: determine-watcher-version
run: echo version="$(gh release view --repo e-dant/watcher --json tagName --template '{{ .tagName }}')" >> "${GITHUB_OUTPUT}"
shell: bash
env:
GH_TOKEN: ${{ github.token }}
-
name: Cache e-dant/watcher
- name: Cache e-dant/watcher
id: cache-watcher
uses: actions/cache@v4
with:
path: watcher/target
key: watcher-${{ runner.os }}-${{ runner.arch }}-${{ steps.determine-watcher-version.outputs.version }}-${{ env.CC && env.CC || 'gcc' }}
-
if: steps.cache-watcher.outputs.cache-hit != 'true'
- if: steps.cache-watcher.outputs.cache-hit != 'true'
name: Compile e-dant/watcher
run: |
mkdir watcher
Expand All @@ -30,8 +27,7 @@ runs:
shell: bash
env:
GH_TOKEN: ${{ github.token }}
-
name: Update LD_LIBRARY_PATH
- name: Update LD_LIBRARY_PATH
run: |
sudo sh -c "echo ${PWD}/watcher/target/lib > /etc/ld.so.conf.d/watcher.conf"
sudo ldconfig
Expand Down
15 changes: 5 additions & 10 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---
version: 2
updates:
-
package-ecosystem: gomod
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
commit-message:
prefix: chore
-
package-ecosystem: gomod
- package-ecosystem: gomod
directory: /caddy
schedule:
interval: weekly
Expand All @@ -18,12 +16,9 @@ updates:
# These packages must be in sync with versions
# used by github.com/caddyserver/caddy/v2
ignore:
-
dependency-name: github.com/google/cel-go
-
dependency-name: github.com/quic-go/*
-
package-ecosystem: github-actions
- dependency-name: github.com/google/cel-go
- dependency-name: github.com/quic-go/*
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
Expand Down
84 changes: 30 additions & 54 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
paths-ignore:
- 'docs/**'
- "docs/**"
push:
branches:
- main
Expand All @@ -18,11 +18,11 @@ on:
inputs:
#checkov:skip=CKV_GHA_7
version:
description: 'FrankenPHP version'
description: "FrankenPHP version"
required: false
type: string
schedule:
- cron: '0 4 * * *'
- cron: "0 4 * * *"
permissions:
contents: read
env:
Expand All @@ -42,8 +42,7 @@ jobs:
skip: ${{ steps.check.outputs.skip }}
ref: ${{ steps.check.outputs.ref || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}
steps:
-
name: Check PHP versions
- name: Check PHP versions
id: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -77,17 +76,14 @@ jobs:
echo ref="$(gh release view --repo dunglas/frankenphp --json tagName --jq '.tagName')"
echo skip=false
} >> "${GITHUB_OUTPUT}"
-
uses: actions/checkout@v4
- uses: actions/checkout@v4
if: ${{ !fromJson(steps.check.outputs.skip) }}
with:
ref: ${{ steps.check.outputs.ref }}
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
if: ${{ !fromJson(steps.check.outputs.skip) }}
uses: docker/setup-buildx-action@v3
-
name: Create variants matrix
- name: Create variants matrix
if: ${{ !fromJson(steps.check.outputs.skip) }}
id: matrix
shell: bash
Expand All @@ -114,55 +110,44 @@ jobs:
variant: ${{ fromJson(needs.prepare.outputs.variants) }}
platform: ${{ fromJson(needs.prepare.outputs.platforms) }}
include:
-
race: ""
- race: ""
qemu: true
-
platform: linux/amd64
- platform: linux/amd64
qemu: false
race: "-race" # The Go race detector is only supported on amd64
-
platform: linux/386
- platform: linux/386
qemu: false
exclude:
# arm/v6 is only available for Alpine: https://github.com/docker-library/golang/issues/502
-
variant: php-${{ needs.prepare.outputs.php82_version }}-bookworm
- variant: php-${{ needs.prepare.outputs.php82_version }}-bookworm
platform: linux/arm/v6
-
variant: php-${{ needs.prepare.outputs.php83_version }}-bookworm
- variant: php-${{ needs.prepare.outputs.php83_version }}-bookworm
platform: linux/arm/v6
steps:
-
name: Prepare
- name: Prepare
id: prepare
run: |
platform=${{ matrix.platform }}
echo "sanitized_platform=${platform//\//-}" >> "${GITHUB_OUTPUT}"
-
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.ref }}
-
name: Set up QEMU
- name: Set up QEMU
if: matrix.qemu
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform }}
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ matrix.platform }}
-
name: Login to DockerHub
- name: Login to DockerHub
if: fromJson(needs.prepare.outputs.push)
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Build
- name: Build
id: build
uses: docker/bake-action@v5
with:
Expand All @@ -187,8 +172,7 @@ jobs:
SHA: ${{ github.sha }}
VERSION: ${{ (github.ref_type == 'tag' && github.ref_name) || needs.prepare.outputs.ref || 'dev' }}
PHP_VERSION: ${{ needs.prepare.outputs.php_version }}
-
# Workaround for https://github.com/actions/runner/pull/2477#issuecomment-1501003600
- # Workaround for https://github.com/actions/runner/pull/2477#issuecomment-1501003600
name: Export metadata
if: fromJson(needs.prepare.outputs.push)
run: |
Expand All @@ -201,26 +185,23 @@ jobs:
touch "/tmp/metadata/runner/${runnerDigest#sha256:}"
env:
METADATA: ${{ steps.build.outputs.metadata }}
-
name: Upload builder metadata
- name: Upload builder metadata
if: fromJson(needs.prepare.outputs.push)
uses: actions/upload-artifact@v4
with:
name: metadata-builder-${{ matrix.variant }}-${{ steps.prepare.outputs.sanitized_platform }}
path: /tmp/metadata/builder/*
if-no-files-found: error
retention-days: 1
-
name: Upload runner metadata
- name: Upload runner metadata
if: fromJson(needs.prepare.outputs.push)
uses: actions/upload-artifact@v4
with:
name: metadata-runner-${{ matrix.variant }}-${{ steps.prepare.outputs.sanitized_platform }}
path: /tmp/metadata/runner/*
if-no-files-found: error
retention-days: 1
-
name: Run tests
- name: Run tests
if: ${{ !matrix.qemu && !fromJson(needs.prepare.outputs.push) }}
run: |
docker run --platform=${{ matrix.platform }} --rm \
Expand All @@ -230,7 +211,7 @@ jobs:
METADATA: ${{ steps.build.outputs.metadata }}
# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/
push:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
needs:
- prepare
- build
Expand All @@ -239,26 +220,22 @@ jobs:
fail-fast: false
matrix:
variant: ${{ fromJson(needs.prepare.outputs.variants) }}
target: ['builder', 'runner']
target: ["builder", "runner"]
steps:
-
name: Download metadata
- name: Download metadata
uses: actions/download-artifact@v4
with:
pattern: metadata-${{ matrix.target }}-${{ matrix.variant }}-*
path: /tmp/metadata
merge-multiple: true
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Create manifest list and push
- name: Create manifest list and push
working-directory: /tmp/metadata
run: |
set -x
Expand All @@ -267,10 +244,9 @@ jobs:
$(printf "${IMAGE_NAME}@sha256:%s " *)
env:
METADATA: ${{ needs.prepare.outputs.metadata }}
-
name: Inspect image
- name: Inspect image
run: |
# shellcheck disable=SC2046,SC2086
docker buildx imagetools inspect $(jq -cr '.target."${{ matrix.target }}-${{ matrix.variant }}".tags | first' <<< ${METADATA})
docker buildx imagetools inspect $(jq -cr '.target."${{ matrix.target }}-${{ matrix.variant }}".tags | first' <<< ${METADATA})
env:
METADATA: ${{ needs.prepare.outputs.metadata }}
13 changes: 7 additions & 6 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ on:
permissions:
contents: read
packages: read
statuses: write
statuses: write
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
-
name: Checkout Code
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Lint Code Base
uses: super-linter/super-linter/slim@v6.8.0
- name: Lint Code Base
uses: super-linter/super-linter/slim@v7.2.1
env:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
Expand All @@ -38,6 +36,9 @@ jobs:
VALIDATE_PHP_PHPSTAN: false
VALIDATE_PHP_PSALM: false
VALIDATE_TERRAGRUNT: false
VALIDATE_DOCKERFILE_HADOLINT: false
# Prettier and StandardJS are incompatible
VALIDATE_JAVASCRIPT_PRETTIER: false
VALIDATE_TYPESCRIPT_PRETTIER: false
# Conflicts with MARKDOWN
VALIDATE_MARKDOWN_PRETTIER: false
Loading

0 comments on commit 77b60f5

Please sign in to comment.