Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
slince committed Oct 22, 2023
1 parent 418d663 commit 4f7480a
Showing 1 changed file with 45 additions and 32 deletions.
77 changes: 45 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,57 @@ name: test

on:
push:
branches: [ 3.x ]
branches: [ "3.x" ]
pull_request:
branches: [ 3.x ]
branches: [ "3.x" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
runs-on: ${{ matrix.operating-system }}
strategy:
max-parallel: 15
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.2', '8.3']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md


- name: Run test suite
run: ./vendor/bin/phpunit --coverage-clover coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Check PHP Version
run: php -v

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
# Docs: https://getcomposer.org/doc/articles/scripts.md

- name: Run test suite
run: ./vendor/bin/phpunit --coverage-clover coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 4f7480a

Please sign in to comment.