diff --git a/.github/workflows/ac-e2e.yml b/.github/workflows/ac-e2e.yml new file mode 100644 index 0000000..600ce27 --- /dev/null +++ b/.github/workflows/ac-e2e.yml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: Apache-2.0 +# Licensed to the Ed-Fi Alliance under one or more agreements. +# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. +# See the LICENSE and NOTICES files in the project root for more information. + +name: Admin Console E2E Tests + +on: + push: + branches: [main] + workflow_dispatch: + pull_request: + branches: + - main + +permissions: read-all + +jobs: + setup-environment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + path: main + + - name: Set environment + run: mv .env.example .env + working-directory: ./main/docker/Compose/ + + - name: Run Admin Console + run: | + docker compose -f docker/Compose/compose-build-dev.yml --env-file docker/Compose/.env up -d + working-directory: ./main/ + + - name: Setup node + uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + with: + node-version: "20" + + - name: Intall project dependencies + run: npm install + working-directory: ./main/ + + - name: Install playwright dependencies + run: npx playwright install + working-directory: ./main/ + + - name: Run test + run: npm run tests + working-directory: ./main/ + + - name: Get Docker logs + if: failure() + run: | + mkdir docker-logs + docker logs adminconsole > docker-logs/adminconsole.log + + - name: Upload Docker logs + if: failure() + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 + with: + name: docker-logs + path: docker-logs/ + retention-days: 10 diff --git a/playwright.config.ts b/playwright.config.ts index e9b12fa..62554fd 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -94,6 +94,6 @@ export default defineConfig({ webServer: { command: 'npm run dev', url: 'http://localhost:8598', - reuseExistingServer: !process.env.CI, + reuseExistingServer: true }, });