Skip to content

Commit

Permalink
[build] Verify analytics configs (#1761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 authored Mar 4, 2025
1 parent d9b7ce2 commit 74506d9
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,18 @@ jobs:
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "dandanplay-app-id"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-5'
name: 'Check that sentryDsn is valid'
timeout-minutes: 5
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "sentry-dsn"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-6'
name: 'Check that analyticsServer is valid'
timeout-minutes: 5
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "analytics-server"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
verify_github-windows-2022:
name: 'Verify (Windows Server 2022 x86_64 (GitHub))'
runs-on:
Expand Down Expand Up @@ -724,6 +736,18 @@ jobs:
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "dandanplay-app-id"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-5'
name: 'Check that sentryDsn is valid'
timeout-minutes: 5
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "sentry-dsn"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-6'
name: 'Check that analyticsServer is valid'
timeout-minutes: 5
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "analytics-server"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
verify_self-hosted-windows-10:
name: 'Verify (Windows 10 x86_64 (Self-Hosted))'
runs-on:
Expand Down Expand Up @@ -755,6 +779,18 @@ jobs:
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "dandanplay-app-id"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-4'
name: 'Check that sentryDsn is valid'
timeout-minutes: 5
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "sentry-dsn"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-5'
name: 'Check that analyticsServer is valid'
timeout-minutes: 5
shell: 'powershell'
run: 'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${{ github.workspace }}/ci-helper/verify/run-ani-test-windows-x64.ps1" "${{ github.workspace }}\ci-helper\verify" "analytics-server"'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
verify_self-hosted-macos-15:
name: 'Verify (macOS 15 AArch64 (Self-Hosted))'
runs-on:
Expand Down Expand Up @@ -783,6 +819,16 @@ jobs:
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg dandanplay-app-id'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-4'
name: 'Check that sentryDsn is valid'
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg sentry-dsn'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-5'
name: 'Check that analyticsServer is valid'
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg analytics-server'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
verify_github-macos-14:
name: 'Verify (macOS 14 AArch64 (GitHub))'
runs-on:
Expand Down Expand Up @@ -817,6 +863,16 @@ jobs:
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg dandanplay-app-id'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-5'
name: 'Check that sentryDsn is valid'
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg sentry-dsn'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-6'
name: 'Check that analyticsServer is valid'
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg analytics-server'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
verify_github-macos-15:
name: 'Verify (macOS 15 AArch64 (GitHub))'
runs-on:
Expand Down Expand Up @@ -851,3 +907,13 @@ jobs:
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg dandanplay-app-id'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-5'
name: 'Check that sentryDsn is valid'
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg sentry-dsn'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
- id: 'step-6'
name: 'Check that analyticsServer is valid'
timeout-minutes: 5
run: '"$GITHUB_WORKSPACE/ci-helper/verify/run-ani-test-macos-aarch64.sh" "$GITHUB_WORKSPACE"/*.dmg analytics-server'
if: '${{ (github.repository == ''open-ani/animeko'') && (!(github.event_name == ''pull_request'')) }}'
10 changes: 10 additions & 0 deletions .github/workflows/src.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,16 @@ fun getVerifyJobBody(
step = "Check that Dandanplay APP ID is valid",
`if` = expr { github.isAnimekoRepository and !github.isPullRequest }
),
VerifyTask(
name = "sentry-dsn",
step = "Check that sentryDsn is valid",
`if` = expr { github.isAnimekoRepository and !github.isPullRequest }
),
VerifyTask(
name = "analytics-server",
step = "Check that analyticsServer is valid",
`if` = expr { github.isAnimekoRepository and !github.isPullRequest }
),
)

when (runner.os to runner.arch) {
Expand Down
20 changes: 20 additions & 0 deletions app/desktop/src/main/kotlin/TestTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ object TestTasks {
exitProcess(0)
}

"sentry-dsn" -> {
if (currentAniBuildConfig.sentryDsn.isBlank()) {
logger.error { "sentryDsn is empty" }
exitProcess(1)
}
exitProcess(0)
}

"analytics-server" -> {
if (currentAniBuildConfig.analyticsServer.isBlank()) {
logger.error { "analyticsServer is empty" }
exitProcess(1)
}
if (currentAniBuildConfig.analyticsKey.isBlank()) {
logger.error { "analyticsKey is empty" }
exitProcess(1)
}
exitProcess(0)
}

else -> {
logger.error { "Unknown test task: $taskName" }
exitProcess(1)
Expand Down

0 comments on commit 74506d9

Please sign in to comment.