Skip to content

Commit

Permalink
fix actions
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Feb 25, 2024
1 parent a99b985 commit 2208029
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
run: composer -V
- name: Check PHP Extensions
run: php -m
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"

- name: Validate composer.json
run: composer validate
Expand All @@ -80,7 +82,7 @@ jobs:
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer files
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel-version }}
Expand Down Expand Up @@ -113,24 +115,25 @@ jobs:
run: |
composer update --no-interaction --no-progress --prefer-dist
- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Set results artifact name
id: artifact
run: echo "name=${{ matrix.php-version }}_${{ matrix.laravel-version }}" | sed -e "s/*//g" >> $GITHUB_OUTPUT

- name: Setup problem matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run test suite
run: vendor/bin/phpunit -c phpunit.xml --log-junit ./results/results_${{ matrix.psr7 }}.xml --coverage-clover ./results/coverage_${{ matrix.psr7 }}.xml

- name: Fix results files
if: success() || failure()
run: sed -i -e "s%$GITHUB_WORKSPACE/%%g" *.xml
working-directory: results
if: success() || failure()

- name: Store results
if: matrix.php-version == env.default-php-version && matrix.laravel-version == env.default-laravel-version && (success() || failure())
uses: actions/upload-artifact@v3
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: results
name: results_${{ steps.artifact.outputs.name }}
path: results


Expand All @@ -149,16 +152,19 @@ jobs:
fetch-depth: 0

- name: Download results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: results
name: ${{ format('results_{0}_{1}*', env.default-php-version, env.default-laravel-version) }}
path: results
merge-multiple: true

- name: Merge junit files
run: |
mkdir -p $RUNNER_TEMP/junit-merge
cd $RUNNER_TEMP/junit-merge
npm init -y
yarn set version berry
yarn dlx junit-report-merger ./results/results.xml "./results/results*.xml"
yarn dlx junit-merge --recursive --dir $GITHUB_WORKSPACE/results --out $GITHUB_WORKSPACE/results/results.xml
- name: Set coverage list
id: coverage
Expand Down Expand Up @@ -216,7 +222,7 @@ jobs:

- name: Store changelog file
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: changelog
path: CHANGELOG.md

0 comments on commit 2208029

Please sign in to comment.