CI #335
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
schedule: | |
- cron: '0 0 * * MON' | |
jobs: | |
check-cs: | |
name: Check Coding Standards | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: PHP-CS-Fixer | |
uses: docker://oskarstark/php-cs-fixer-ga | |
with: | |
args: --config=.php-cs-fixer.php --diff --dry-run | |
check-spec: | |
name: Check SDK is in sync with spec | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: composer update --no-interaction | |
- name: Regenerate SDK library | |
run: rm -rf generated && vendor/bin/jane-openapi generate --config-file=.jane-openapi.php | |
- name: Check is something changed | |
run: | | |
set -e | |
git diff --exit-code | |
tests: | |
name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: [ '7.4', '8.0', '8.1' ] | |
composer-flags: [ '' ] | |
name: [ '' ] | |
include: | |
- php-version: 7.4 | |
composer-flags: '--prefer-lowest' | |
name: '(prefer lowest dependencies)' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
extensions: mbstring, xml | |
- name: Install dependencies | |
run: "composer update --no-interaction ${{ matrix.composer-flags }}" | |
- name: Run tests | |
run: php vendor/bin/simple-phpunit | |
env: | |
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} | |
SLACK_TEST_CHANNEL: ${{ secrets.SLACK_TEST_CHANNEL }} | |
CI: ${{ vars.CI }} |