Install Psalm & PHP CS #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] | |
composer: ['2'] | |
latest: [false] | |
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: | | |
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'] | |
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 |