mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
build: don't run e2e tests every
This commit is contained in:
parent
dbaaab8faa
commit
6a9d39838c
3 changed files with 104 additions and 24 deletions
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
|
|
@ -59,21 +59,9 @@ jobs:
|
|||
- name: Test Unit
|
||||
run: npm run test
|
||||
|
||||
- name: Start WebDAV Server
|
||||
run: |
|
||||
docker compose up -d webdav
|
||||
|
||||
# Wait for WebDAV server to be ready
|
||||
chmod +x ./scripts/wait-for-webdav.sh
|
||||
./scripts/wait-for-webdav.sh
|
||||
|
||||
- name: Test E2E
|
||||
run: npm run e2e
|
||||
|
||||
- name: Print WebDAV logs on failure
|
||||
if: ${{ failure() }}
|
||||
run: docker compose logs webdav
|
||||
|
||||
- name: 'Upload E2E results on failure'
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v6
|
||||
|
|
|
|||
104
.github/workflows/e2e-scheduled.yml
vendored
Normal file
104
.github/workflows/e2e-scheduled.yml
vendored
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
name: 'E2E Tests (Scheduled)'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *' # 2 AM UTC daily
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
push:
|
||||
branches: [master, release/*]
|
||||
paths:
|
||||
- 'src/app/imex/sync/**'
|
||||
- 'src/app/op-log/**'
|
||||
- 'e2e/tests/**'
|
||||
- 'docker-compose.yaml'
|
||||
- 'docker-compose.supersync.yaml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
e2e-tests:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
UNSPLASH_KEY: ${{ secrets.UNSPLASH_KEY }}
|
||||
UNSPLASH_CLIENT_ID: ${{ secrets.UNSPLASH_CLIENT_ID }}
|
||||
|
||||
steps:
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Reconfigure git to use HTTP authentication
|
||||
run: >
|
||||
git config --global url."https://github.com/".insteadOf
|
||||
ssh://git@github.com/
|
||||
|
||||
- name: Get npm cache directory
|
||||
id: npm-cache-dir
|
||||
run: |
|
||||
echo "::set-output name=dir::$(npm config get cache)"
|
||||
|
||||
- uses: actions/cache@v5
|
||||
id: npm-cache
|
||||
with:
|
||||
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install npm Packages
|
||||
run: npm i
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: |
|
||||
npx playwright install --with-deps chromium
|
||||
npx playwright install-deps chromium
|
||||
|
||||
- run: npm run env
|
||||
|
||||
- name: Start Docker Services (WebDAV + SuperSync)
|
||||
run: |
|
||||
docker compose up -d webdav
|
||||
docker compose -f docker-compose.yaml -f docker-compose.supersync.yaml up -d --build supersync
|
||||
|
||||
# Wait for WebDAV
|
||||
chmod +x ./scripts/wait-for-webdav.sh
|
||||
./scripts/wait-for-webdav.sh
|
||||
|
||||
# Wait for SuperSync
|
||||
echo "⏳ Waiting for SuperSync server..."
|
||||
until curl -s http://localhost:1901/health > /dev/null 2>&1; do sleep 1; done
|
||||
echo "✓ SuperSync server ready!"
|
||||
|
||||
- name: Run E2E Tests
|
||||
run: npm run e2e
|
||||
|
||||
- name: Stop Docker Services
|
||||
if: always()
|
||||
run: |
|
||||
docker compose down
|
||||
docker compose -f docker-compose.yaml -f docker-compose.supersync.yaml down supersync
|
||||
|
||||
- name: Print Docker Logs on Failure
|
||||
if: ${{ failure() }}
|
||||
run: |
|
||||
echo "=== WebDAV Logs ==="
|
||||
docker compose logs webdav
|
||||
echo "=== SuperSync Logs ==="
|
||||
docker compose -f docker-compose.yaml -f docker-compose.supersync.yaml logs supersync
|
||||
|
||||
- name: Upload E2E Results on Failure
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: e2e-results-${{ github.run_id }}
|
||||
path: .tmp/e2e-test-results/**/*.*
|
||||
retention-days: 30
|
||||
12
.github/workflows/lint-and-test-pr.yml
vendored
12
.github/workflows/lint-and-test-pr.yml
vendored
|
|
@ -50,18 +50,6 @@ jobs:
|
|||
- run: npm run lint
|
||||
- run: npm run int:test # Validate i18n JSON files
|
||||
- run: npm run test
|
||||
- name: Start WebDAV Server
|
||||
run: |
|
||||
docker compose up -d webdav
|
||||
|
||||
# Wait for WebDAV server to be ready
|
||||
chmod +x ./scripts/wait-for-webdav.sh
|
||||
./scripts/wait-for-webdav.sh
|
||||
- run: npm run e2e
|
||||
- name: Print WebDAV logs on failure
|
||||
if: ${{ failure() }}
|
||||
run: docker compose logs webdav
|
||||
|
||||
- name: 'Upload E2E results on failure'
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v6
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue