Skip to content

Document local admin installer command #19

Document local admin installer command

Document local admin installer command #19

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Serverpod Admin CI
on:
workflow_dispatch:
release:
types:
- published
push:
branches:
- main
- dev
tags:
- 'v*'
pull_request:
branches:
- main
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: write
jobs:
dart_analyze_server:
name: dart analyze (server)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ['3.32.0', '3.38.4']
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
- name: Install dependencies
working-directory: serverpod_admin_server
run: dart pub get
- name: Analyze server source
working-directory: serverpod_admin_server
run: dart analyze
dart_analyze_dashboard:
name: dart analyze (dashboard)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ['3.32.0', '3.38.4']
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
- name: Install dependencies
working-directory: serverpod_admin_dashboard
run: flutter pub get
- name: Analyze dashboard source
working-directory: serverpod_admin_dashboard
run: |
# Run analyze and filter out expected warnings for monorepo
OUTPUT=$(flutter analyze 2>&1) || true
# Filter out expected warnings:
# 1. Path dependency warning (expected in monorepo)
# 2. DropdownButtonFormField value deprecation (initialValue not available in tested Flutter versions)
FILTERED=$(echo "$OUTPUT" | grep -v "Publishable packages can't have 'path' dependencies" | grep -v "Use initialValue instead")
echo "$FILTERED"
# Count real issues (excluding expected warnings)
REAL_ISSUES=$(echo "$FILTERED" | grep -cE "(error|warning|info) •" || echo "0")
if [ "$REAL_ISSUES" -gt "0" ]; then
echo "Found $REAL_ISSUES analysis issue(s)"
exit 1
fi
echo "Analysis passed (expected warnings ignored)"
server_integration_tests:
name: Server integration tests
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ['3.32.0', '3.38.4']
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: serverpod_admin_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
- name: Install dependencies
working-directory: serverpod_admin_server
run: dart pub get
- name: Update test configuration for CI
working-directory: serverpod_admin_server
run: |
# Update test.yaml to use standard ports for GitHub Actions
sed -i 's/port: 9090/port: 5432/' config/test.yaml
sed -i 's/port: 9091/port: 6379/' config/test.yaml
# Keep Redis disabled for CI since GitHub Actions Redis doesn't require password
# but Serverpod tries to authenticate when enabled
# sed -i 's/enabled: false/enabled: true/' config/test.yaml
# Update passwords.yaml with CI password (postgres for database, no redis password)
cat > config/passwords.yaml << EOF
test:
database: 'postgres'
EOF
- name: Run server tests
working-directory: serverpod_admin_server
run: dart test --reporter=failures-only
dashboard_unit_tests:
name: Dashboard unit tests
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ['3.32.0', '3.38.4']
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
- name: Install dependencies
working-directory: serverpod_admin_dashboard
run: flutter pub get
- name: Run dashboard tests
working-directory: serverpod_admin_dashboard
run: flutter test --reporter=failures-only
build_admin_app:
name: Build prebuilt admin app
runs-on: ubuntu-latest
strategy:
matrix:
flutter-version: ['3.38.4']
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
- name: Install dependencies
working-directory: serverpod_admin_app
run: flutter pub get
- name: Analyze admin app
working-directory: serverpod_admin_app
run: flutter analyze
- name: Build Flutter web app
working-directory: serverpod_admin_app
run: flutter build web --base-href /admin/
- name: Package web build
working-directory: serverpod_admin_app/build/web
run: zip -r ../../../serverpod_admin_dashboard_web.zip .
- name: Upload admin app artifact
uses: actions/upload-artifact@v4
with:
name: serverpod_admin_dashboard_web
path: serverpod_admin_dashboard_web.zip
- name: Attach admin app to GitHub release
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="${GITHUB_REF_NAME}"
if [ "${{ github.event_name }}" = "release" ]; then
TAG_NAME="${{ github.event.release.tag_name }}"
fi
gh release view "$TAG_NAME" >/dev/null 2>&1 || \
gh release create "$TAG_NAME" \
--title "$TAG_NAME" \
--notes "Serverpod Admin release $TAG_NAME"
gh release upload "$TAG_NAME" \
serverpod_admin_dashboard_web.zip \
--clobber