Skip to content

Commit

Permalink
[#278] test packages independently
Browse files Browse the repository at this point in the history
  • Loading branch information
kpicaza committed Jun 25, 2021
1 parent 9ee3270 commit 054931a
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/split_phpunit.yaml
@@ -0,0 +1,57 @@
name: Split Monorepo PHPUnit tests

on:
pull_request:
push:
branches:
- 1.0.x

jobs:
provide_packages_json:
# see json juggling: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#example-6
# see https://stackoverflow.com/a/62953566/1348344
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version:
- "7.4"
operating-system:
- "ubuntu-latest"

steps:
-
uses: actions/checkout@v2

# required for matrix of packages set
- uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: "pcov"
ini-values: memory_limit=-1
- uses: "ramsey/composer-install@v1"
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# get package json list
-
id: output_data
run: echo "::set-output name=matrix::$(vendor/bin/monorepo-builder packages-json)"

# this step is needed, so the output gets to the next defined job
outputs:
matrix: ${{ steps.output_data.outputs.matrix }}

split_monorepo_phpunit_test:
needs: provide_packages_json

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{fromJson(needs.provide_packages_json.outputs.matrix)}}

steps:
-
uses: actions/checkout@v2

- name: "Tests ${{ matrix.package }}"
run: "cd packages/${{ matrix.package }} && composer update --no-interaction --no-progress --no-suggest && composer check-all && cd ../.."

0 comments on commit 054931a

Please sign in to comment.