Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
php-version: 8.2
secrets:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

build:
name: Build
Expand All @@ -44,7 +44,7 @@ jobs:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
with:
branch: ${{ needs.prepare.outputs.target-branch }}
composer-cache: ${{ needs.prepare.outputs.composer-cache }}
composer-cache-dir: ${{ needs.prepare.outputs.composer-cache-dir }}
composer-cache-key: ${{ needs.prepare.outputs.composer-cache-key }}
sentry-project: ${{ vars.SENTRY_PROJECT }}
target-env: ${{ github.event_name == 'workflow_dispatch' && inputs.target || matrix.target }}
Expand Down
37 changes: 15 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
prepare:
name: Prepare
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 }}

build:
name: Build
Expand All @@ -27,7 +29,7 @@ jobs:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
with:
branch: ${{ needs.prepare.outputs.target-branch }}
composer-cache: ${{ needs.prepare.outputs.composer-cache }}
composer-cache-dir: ${{ needs.prepare.outputs.composer-cache-dir }}
composer-cache-key: ${{ needs.prepare.outputs.composer-cache-key }}
sentry-project: ${{ vars.SENTRY_PROJECT }}

Expand Down Expand Up @@ -80,7 +82,7 @@ jobs:
- name: Prepare Composer Cache
uses: actions/cache@v5
with:
path: ${{ needs.prepare.outputs.composer-cache }}
path: ${{ needs.prepare.outputs.composer-cache-dir }}
key: ${{ needs.prepare.outputs.composer-cache-key }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ needs.prepare.outputs.composer-cache-key }}-composer-

Expand All @@ -100,23 +102,16 @@ jobs:
- name: Run unit tests
run: php artisan test --ansi --coverage

- name: Generate reports for CodeClimate
id: reports
if: needs.prepare.outputs.has-codeclimate == '1'
- name: Generate reports for Coveralls
if: needs.prepare.outputs.has-coveralls == '1'
uses: coverallsapp/github-action@v2
env:
CODECLIMATE_REPORT: tests/reports/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 clover -o $CODECLIMATE_REPORT tests/reports/clover.xml

- name: Upload tests reports
if: needs.prepare.outputs.has-codeclimate == '1'
uses: actions/upload-artifact@v7
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
name: test-reports-${{ matrix.php }}
path: tests/reports/codeclimate.${{ matrix.php }}.json
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: php-${{ matrix.php }}
file: tests/coverage/clover.xml
parallel: true

e2e:
name: Integration Test on BrowserStack
Expand Down Expand Up @@ -166,7 +161,7 @@ jobs:
- name: Prepare Composer Cache
uses: actions/cache@v5
with:
path: ${{ needs.prepare.outputs.composer-cache }}
path: ${{ needs.prepare.outputs.composer-cache-dir }}
key: ${{ needs.prepare.outputs.composer-cache-key }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ needs.prepare.outputs.composer-cache-key }}-composer-

Expand Down Expand Up @@ -209,6 +204,4 @@ jobs:
uses: projek-xyz/actions/.github/workflows/report.yml@main
needs: [prepare, units]
with:
has-codeclimate: ${{ needs.prepare.outputs.has-codeclimate == '1' }}
secrets:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
has-coveralls: ${{ needs.prepare.outputs.has-coveralls == '1' }}
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ jobs:
publish:
name: Publish Release
uses: projek-xyz/actions/.github/workflows/release.yml@main
permissions:
contents: write
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
"@php artisan package:discover --ansi",
"@ziggy:generate"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
Expand All @@ -92,7 +93,7 @@
"@test:e2e"
],
"ziggy:generate": [
"@php artisan ziggy:generate ./resources/client/ziggy.cjs --ansi"
"@php artisan ziggy:generate ./resources/client/ziggy --ansi"
]
},
"extra": {
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
</testsuites>
<coverage>
<report>
<clover outputFile="tests/reports/clover.xml"/>
<clover outputFile="tests/coverage/clover.xml"/>
<html outputDirectory="tests/coverage"/>
</report>
</coverage>
<logging>
<junit outputFile="tests/reports/junit.xml"/>
<junit outputFile="tests/coverage/junit.xml"/>
</logging>
<php>
<env name="APP_ENV" value="testing"/>
Expand Down
2 changes: 1 addition & 1 deletion resources/client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
auto-imports.d.ts
components.d.ts
ziggy.cjs
ziggy.js
2 changes: 1 addition & 1 deletion resources/client/modules/inertia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { router } from '@inertiajs/core'
import type { Config } from 'ziggy-js'
import ziggyRoute from 'ziggy-js'

import { Ziggy } from '~/ziggy.cjs'
import { Ziggy } from '~/ziggy.js'

export type AppRoutes = typeof Ziggy.routes
export type RouteFunction = typeof ziggyRoute
Expand Down
Loading