Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: switch back to projek-xyz/actions workflows #64

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
jobs:
prepare:
name: Prepare
uses: feryardiant/actions/.github/workflows/configure.yml@main
uses: projek-xyz/actions/.github/workflows/configure.yml@main
with:
php-version: 8.2
secrets:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down Expand Up @@ -43,28 +45,17 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ needs.prepare.outputs.composer-cache }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php }}-composer-

- name: Install dependencies
run: composer update --prefer-dist --no-progress --no-suggest

- name: Run tests
run: composer test

- name: Generate reports for CodeClimate
if: needs.prepare.outputs.has-codeclimate == 'true'
id: reports
env:
CODECLIMATE_REPORT: tests/codeclimate.${{ matrix.php }}.json
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CC_TEST_REPORTER_URL: ${{ vars.CC_TEST_REPORTER_URL }}
run: |
curl -LSs $CC_TEST_REPORTER_URL > ./cc-test-reporter && chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov -o $CODECLIMATE_REPORT tests/lcov.info

- name: Generate reports for Coveralls
if: needs.prepare.outputs.has-coveralls == 'true'
if: needs.prepare.outputs.has-coveralls == '1'
uses: coverallsapp/github-action@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand All @@ -74,8 +65,19 @@ jobs:
file: tests/lcov.info
parallel: true

- name: Generate reports for CodeClimate
if: needs.prepare.outputs.has-codeclimate == '1'
id: reports
env:
CODECLIMATE_REPORT: tests/codeclimate.${{ matrix.php }}.json
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CC_TEST_REPORTER_URL: ${{ vars.CC_TEST_REPORTER_URL }}
run: |
curl -LSs $CC_TEST_REPORTER_URL > ./cc-test-reporter && chmod +x ./cc-test-reporter
./cc-test-reporter format-coverage -t lcov -o $CODECLIMATE_REPORT tests/lcov.info

- name: Save Coverage Reports
if: needs.prepare.outputs.has-codeclimate == 'true'
if: needs.prepare.outputs.has-codeclimate == '1'
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ matrix.php }}
Expand All @@ -85,9 +87,9 @@ jobs:
name: Reports
needs: [prepare, tests]
if: needs.prepare.outputs.should-reports == '1'
uses: feryardiant/actions/.github/workflows/report.yml@main
uses: projek-xyz/actions/.github/workflows/report.yml@main
secrets:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
has-coveralls: ${{ needs.prepare.outputs.has-coveralls == 'true' }}
has-codeclimate: ${{ needs.prepare.outputs.has-codeclimate == 'true' }}
has-coveralls: ${{ needs.prepare.outputs.has-coveralls == '1' }}
has-codeclimate: ${{ needs.prepare.outputs.has-codeclimate == '1' }}