1a9c518f96
Provide TOTP-authenticated, role-controlled user and credit workflows with paginated audit data and SQL-backed statistics so operations can manage growth safely.
96 lines
2.9 KiB
YAML
96 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: npm
|
|
cache-dependency-path: admin-web/package-lock.json
|
|
- uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
- uses: gradle/actions/setup-gradle@v4
|
|
- name: Verify Docker for MySQL integration tests
|
|
run: docker info
|
|
- name: Validate production Compose
|
|
env:
|
|
APP_STORE_URL: https://apps.apple.com/app/id1234567890
|
|
DATABASE_URL: jdbc:mysql://mysql:3306/osg_account
|
|
DATABASE_USER: runtime
|
|
DATABASE_PASSWORD: runtime-password
|
|
DATABASE_MIGRATION_USER: migrator
|
|
DATABASE_MIGRATION_PASSWORD: migration-password
|
|
JWT_SECRET: 01234567890123456789012345678901
|
|
FIELD_ENCRYPTION_KEY: BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc=
|
|
IDENTITY_HMAC_KEY: CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg=
|
|
APPLE_TEAM_ID: X329MZU23S
|
|
APPLE_KEY_ID: CI_KEY
|
|
APPLE_PRIVATE_KEY_PEM: ci-private-key-placeholder
|
|
VOLCENGINE_API_KEY: ci-volcengine-key
|
|
DEEPSEEK_API_KEY: ci-deepseek-key
|
|
run: docker compose -f compose.yaml config --quiet
|
|
- name: Test
|
|
run: ./gradlew --no-daemon clean test
|
|
- name: Upload test reports
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-reports-${{ github.run_id }}
|
|
path: |
|
|
build/reports/tests/test
|
|
build/test-results/test
|
|
if-no-files-found: ignore
|
|
- name: Build deployable JAR
|
|
run: ./gradlew --no-daemon buildFatJar
|
|
- name: Build container
|
|
run: docker build -t osg-account-server:ci .
|
|
|
|
publish:
|
|
if: github.event_name == 'push'
|
|
needs: verify
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: docker/setup-buildx-action@v3
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- uses: docker/metadata-action@v5
|
|
id: metadata
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/osg-account-server
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=tag
|
|
type=sha,prefix=sha-
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.metadata.outputs.tags }}
|
|
labels: ${{ steps.metadata.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|