Skip to content

Harden GitHub workflows #1865

Harden GitHub workflows

Harden GitHub workflows #1865

Workflow file for this run

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'
push:
branches: ['master']
paths-ignore:
- 'docs/**'
- 'README.md'
- 'CHANGELOG.md'
- '.gitignore'
- '.gitattributes'
- 'psalm.xml'
name: build
permissions:
contents: read
jobs:
codeception:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
env:
key: cache-v1
APP_C3: true
APP_ENV: test
APP_DEBUG: false
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
php:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
steps:
- name: Checkout.
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
with:
persist-credentials: false
- name: Install PHP with extensions.
uses: shivammathur/setup-php@b604ade2a87db23f8871b7182e69ec5e75effb45
with:
coverage: false
extensions: fileinfo, intl
ini-values: date.timezone='UTC', register_argc_argv=On
php-version: ${{ matrix.php }}
- name: Install Composer dependencies
uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f
- name: Run codeception build.
run: vendor/bin/codecept build
- name: Run tests with codeception with code coverage with shell bash.
if: matrix.os == 'ubuntu-latest'
run: vendor/bin/codecept run --coverage --coverage-xml --disable-coverage-php
- name: Run tests with codeception with code coverage with shell powershell.
if: matrix.os == 'windows-latest'
run: vendor/bin/codecept run
shell: powershell
- name: Upload coverage to Codecov.
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: runtime/tests/_output/coverage.xml