Nightly Test #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # LinaPro nightly health test workflow. | |
| # GitHub cron uses UTC. 16:00 UTC is 00:00 Asia/Shanghai. | |
| name: Nightly Test | |
| on: | |
| schedule: | |
| - cron: "0 16 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: "${{ github.workflow }} @ nightly" | |
| cancel-in-progress: false | |
| env: | |
| TZ: "Asia/Shanghai" | |
| jobs: | |
| backend-unit-tests: | |
| name: Go unit tests | |
| uses: ./.github/workflows/reusable-backend-unit-tests.yml | |
| frontend-unit-tests: | |
| name: Frontend unit tests | |
| uses: ./.github/workflows/reusable-frontend-unit-tests.yml | |
| e2e-tests: | |
| name: Full E2E tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 180 | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: 12345678 | |
| MYSQL_DATABASE: linapro | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -p12345678" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - name: Setup Timezone | |
| uses: szenius/set-timezone@v2.0 | |
| with: | |
| timezoneLinux: "Asia/Shanghai" | |
| - name: Checkout Repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| cache-dependency-path: "**/go.sum" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: "10.30.3" | |
| run_install: false | |
| - name: Setup Node | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version-file: "apps/lina-vben/.node-version" | |
| cache: "pnpm" | |
| cache-dependency-path: "apps/lina-vben/pnpm-lock.yaml" | |
| - name: Install MySQL Client | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y default-mysql-client lsof | |
| - name: Install Frontend Dependencies | |
| working-directory: apps/lina-vben | |
| run: pnpm install --frozen-lockfile | |
| - name: Install E2E Dependencies | |
| working-directory: hack/tests | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| working-directory: hack/tests | |
| run: npx playwright install --with-deps chromium | |
| - name: Initialize Database | |
| run: | | |
| cp apps/lina-core/manifest/config/config.template.yaml apps/lina-core/manifest/config/config.yaml | |
| make init confirm=init rebuild=true | |
| make mock confirm=mock | |
| - name: Start Services | |
| run: make dev | |
| - name: Run Full E2E Suite | |
| working-directory: hack/tests | |
| env: | |
| E2E_BASE_URL: "http://127.0.0.1:5666" | |
| E2E_API_BASE_URL: "http://127.0.0.1:8080/api/v1/" | |
| E2E_PUBLIC_BASE_URL: "http://127.0.0.1:8080" | |
| E2E_PARALLEL_WORKERS: "4" | |
| run: pnpm test | |
| - name: Stop Services | |
| if: always() | |
| run: make stop | |
| - name: Upload E2E Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nightly-e2e-report | |
| path: | | |
| hack/tests/playwright-report/ | |
| hack/tests/test-results/ | |
| temp/lina-core.log | |
| temp/lina-vben.log | |
| if-no-files-found: ignore | |
| retention-days: 14 |