-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (98 loc) · 3.01 KB
/
Copy pathbuild.yaml
File metadata and controls
116 lines (98 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: "Build"
on:
push:
branches:
- main
paths:
- Dockerfile
- .docker/**
- .github/workflows/build.yaml
permissions:
contents: 'read'
id-token: 'write'
packages: write
jobs:
packaging:
strategy:
fail-fast: false
matrix:
php: ['8.4']
composer: ['2']
latest: [true]
# include:
# - php: 8.3
# composer: 2
# latest: true
runs-on: ubuntu-latest
name: "Composer v${{ matrix.composer }} PHP ${{ matrix.php }} package"
steps:
- name: Checkout
uses: "actions/checkout@v3"
- name: Login to GitHub Container Registry
uses: 'docker/login-action@v1'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_REPOSITORY_TOKEN }}
- name: Process builder
shell: bash
run: |
echo "build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
- name: Set up Depot CLI
uses: 'depot/setup-action@v1'
- name: Build and Push Package
uses: 'depot/build-push-action@v1'
with:
project: ${{ secrets.DEPOT_PROJECT_ID }}
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
push: true
provenance: false
sbom: false
tags: |
ghcr.io/devgine/composer-php:v${{ matrix.composer }}-php${{ matrix.php }}-alpine
${{ matrix.latest && 'ghcr.io/devgine/composer-php:latest' || ''}}
context: .
file: ./Dockerfile
build-args: |
PHP_CS_FIXER_IGNORE_ENV=${{ matrix.php > 8.3 }}
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ env.build_date }}
BUILD_VERSION=v${{ matrix.composer }}-php${{ matrix.php }}-alpine
PHP_VERSION=${{ matrix.php }}
COMPOSER_VERSION=${{ matrix.composer }}
IMAGE_TAG=ghcr.io/devgine/composer-php:v${{ matrix.composer }}-php${{ matrix.php }}-alpine
components:
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
composer: ['2']
needs: packaging
runs-on: ubuntu-latest
name: "Composer v${{ matrix.composer }} PHP ${{ matrix.php }} versions"
container:
image: ghcr.io/devgine/composer-php:v${{ matrix.composer }}-php${{ matrix.php }}-alpine
steps:
- name: OS release
run: cat /etc/os-release
- name: Composer
run: composer --version
- name: PHP
run: php --version
- name: PHP Unit
run: simple-phpunit --version
- name: Rector
run: rector -V
- name: PHPStan
run: phpstan --version
- name: Psalm
run: psalm --version
- name: PHP Code Standard Fixer
run: php-cs-fixer --version
- name: PHP Code Sniffer
run: phpcs --version
- name: PHP Mess Detector
run: phpmd --version
- name: PHP Copy Past Detector
if: ${{ matrix.php >= 7.3 }}
run: phpcpd --version