Skip to content

Cleanup GitHub workflows (#289) #1884

Cleanup GitHub workflows (#289)

Cleanup GitHub workflows (#289) #1884

Workflow file for this run

name: build
on:
pull_request:
paths: &paths
- 'public/**'
- 'src/**'
- 'config/**'
- 'tests/**'
- 'codeception.yml'
- 'composer.json'
- 'yii'
- 'yii.bat'
- '.github/workflows/build.yml'
push:
branches: ['master']
paths: *paths
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install PHP with extensions.
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
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@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
- 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@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: runtime/tests/_output/coverage.xml