Skip to content

Commit 18a078d

Browse files
committed
feat: switch to docker bake action
Repository now uses docker bake github action together with docker-bake.hcl style: various fixes in yaml files feat: added php 8.3 support feat: separate workflow for image testing
1 parent 4c0619b commit 18a078d

File tree

17 files changed

+288
-127
lines changed

17 files changed

+288
-127
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
lotyp7@gmail.com.
63+
the@wayof.dev.
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the

.github/labeler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
"type: documentation":
77
- changed-files:
8-
- any-glob-to-any-file: [ 'assets/**/*', '.github/*', './*.md' ]
8+
- any-glob-to-any-file: ['assets/**/*', '.github/*.yml', './*.md']
99

1010
"type: maintenance":
1111
- changed-files:
12-
- any-glob-to-any-file: [ '.github/workflows/*' ]
12+
- any-glob-to-any-file: ['.github/workflows/*']
1313

1414
...

.github/workflows/build-latest.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/build-release.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/shellcheck.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
22

3+
concurrency:
4+
group: "${{ github.workflow }}-${{ github.ref }}"
5+
cancel-in-progress: true
6+
37
on: # yamllint disable-line rule:truthy
48
pull_request:
59

.github/workflows/test.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
3+
concurrency:
4+
group: "${{ github.workflow }}-${{ github.ref }}"
5+
cancel-in-progress: true
6+
7+
on: # yamllint disable-line rule:truthy
8+
pull_request:
9+
paths-ignore:
10+
- '**.md'
11+
12+
env:
13+
DOCKER_NAMESPACE: wayofdev/php-dev
14+
GHCR_NAMESPACE: ghcr.io/wayofdev/docker-php-dev
15+
16+
name: 🧪 Test Docker images
17+
18+
jobs:
19+
test:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os_name: ["alpine"]
24+
php_version: ["8.1", "8.2", "8.3"]
25+
php_type: ["fpm", "cli", "supervisord"]
26+
builder: [{arch: "amd64", os: "ubuntu-latest"}]
27+
runs-on: ${{ matrix.builder.os }}
28+
steps:
29+
30+
- name: 🌎 Set environment variables
31+
run: |
32+
php_version="${{ matrix.php_version }}"
33+
tag="${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}-${{ matrix.builder.arch }}"
34+
php_version_slug="${php_version//./}"
35+
target="php-${php_version_slug}-${{ matrix.php_type }}-${{ matrix.os_name }}"
36+
echo "TARGET=${target}" >> $GITHUB_ENV
37+
echo "PLATFORM_CACHE_TAG=${tag}" >> $GITHUB_ENV
38+
39+
- name: 📦 Check out the codebase
40+
uses: actions/checkout@v4.1.1
41+
42+
- name: 🛠️ Install goss and dgoss
43+
uses: e1himself/goss-installation-action@v1.2.1
44+
with:
45+
version: v0.4.6
46+
47+
- name: 🤖 Generate dist files
48+
run: ansible-playbook src/playbook.yml -l ${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}
49+
50+
- name: 🖥️ Setup docker QEMU
51+
uses: docker/setup-qemu-action@v3
52+
53+
- name: 🛠️ Set up Docker Buildx
54+
uses: docker/setup-buildx-action@v3
55+
with:
56+
buildkitd-flags: "--debug"
57+
58+
- name: 🔑 Login to docker-hub
59+
uses: docker/login-action@v3
60+
with:
61+
username: ${{ secrets.DOCKER_USERNAME }}
62+
password: ${{ secrets.DOCKER_TOKEN }}
63+
64+
- name: 🔑 Login to GHCR
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.repository_owner }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: 🐳 Extract docker meta data
72+
id: meta
73+
uses: docker/metadata-action@v5
74+
with:
75+
images: |
76+
${{ env.DOCKER_NAMESPACE }}
77+
${{ env.GHCR_NAMESPACE }}
78+
tags: |
79+
type=raw,event=branch,value=latest
80+
type=ref,event=pr
81+
type=semver,pattern={{version}}
82+
type=semver,pattern={{major}}.{{minor}}
83+
flavor: |
84+
latest=false
85+
prefix=${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}-
86+
87+
- name: 🧪 Bake image for testing
88+
id: bake
89+
uses: docker/bake-action@v4
90+
with:
91+
targets: ${{ env.TARGET }}
92+
files: |
93+
./docker-bake.hcl
94+
${{ steps.meta.outputs.bake-file }}
95+
set: |
96+
*.tags=
97+
*.platform=linux/${{ matrix.builder.arch }}
98+
*.cache-from=type=gha,scope=build-${{ env.PLATFORM_CACHE_TAG }}
99+
*.cache-to=type=gha,scope=build-${{ env.PLATFORM_CACHE_TAG }}
100+
*.output=type=docker,"name=${{ env.DOCKER_NAMESPACE }},${{ env.GHCR_NAMESPACE }}",name-canonical=true,push=false
101+
102+
- name: 🧪 Test Docker image
103+
run: |
104+
export IMAGE_TEMPLATE=${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}
105+
export IMAGE_TAG=${{ env.DOCKER_NAMESPACE }}:latest
106+
make test

.github/workflows/upload-assets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: 📦 Check out the codebase
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v4.1.1
1818

1919
- name: 🚀 Generate dist files
2020
run: make generate

.hadolint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
3+
trustedRegistries:
4+
- docker.io
5+
- "*.gcr.io"
6+
7+
...

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22

33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
5+
rev: v4.5.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- id: fix-encoding-pragma
1010

1111
- repo: https://github.com/adrienverge/yamllint
12-
rev: v1.31.0
12+
rev: v1.35.1
1313
hooks:
1414
- id: yamllint
1515
files: \.(yaml|yml)$
1616
types: [file, yaml]
1717
entry: yamllint --strict
1818

1919
- repo: https://github.com/commitizen-tools/commitizen
20-
rev: 3.2.2
20+
rev: v3.21.3
2121
hooks:
2222
- id: commitizen
2323
stages:
2424
- commit-msg
2525

2626
- repo: https://github.com/ansible/ansible-lint
27-
rev: v6.16.0
27+
rev: v24.2.1
2828
hooks:
2929
- id: ansible-lint
3030
entry: ansible-lint . --force-color

.yamllint

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ rules:
4747
require-starting-space: true
4848
min-spaces-from-content: 1
4949

50-
line-length:
51-
max: 180
52-
level: warning
50+
line-length: disable
5351

5452
yaml-files:
5553
- "*.yaml"

0 commit comments

Comments
 (0)