Merge release/3.1.0-RC7: OOM修正 + ROOT_FOLDER_ID動的解決 + E2Eテスト品質改善 #147
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
| name: NemakiWare UI Tests with Playwright | |
| on: | |
| push: | |
| branches: [ master, main, develop ] | |
| paths: | |
| - 'core/src/main/webapp/ui/**' | |
| - 'core/src/main/java/**' | |
| - 'core/pom.xml' | |
| - '.github/workflows/ui-tests.yml' | |
| pull_request: | |
| branches: [ master, main, develop ] | |
| paths: | |
| - 'core/src/main/webapp/ui/**' | |
| - 'core/src/main/java/**' | |
| - 'core/pom.xml' | |
| - '.github/workflows/ui-tests.yml' | |
| jobs: | |
| ui-tests: | |
| name: UI Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| - name: Set up Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: 'core/src/main/webapp/ui/package-lock.json' | |
| - name: Build React UI | |
| working-directory: core/src/main/webapp/ui | |
| run: | | |
| # Install dependencies and build the React UI | |
| echo "Installing UI dependencies..." | |
| npm ci | |
| echo "Building React UI..." | |
| npm run build | |
| # Verify the build output | |
| echo "Verifying UI build output..." | |
| ls -la dist/ | |
| test -f dist/index.html || (echo "ERROR: index.html not found in dist/" && exit 1) | |
| - name: Build NemakiWare Dependencies | |
| run: | | |
| # Build parent POM first | |
| echo "Installing parent POM..." | |
| mvn clean install -N -DskipTests -q | |
| # Build dependency modules | |
| echo "Building common module..." | |
| mvn clean install -f common/pom.xml -DskipTests -q | |
| echo "Building cloudant-init module..." | |
| mvn clean install -f cloudant-init/pom.xml -DskipTests -q | |
| echo "Building solr module..." | |
| mvn clean install -f solr/pom.xml -DskipTests -q | |
| - name: Build NemakiWare Core | |
| run: | | |
| # Build the core WAR file with all dependencies | |
| mvn clean package -f core/pom.xml -Pdevelopment -DskipTests -q | |
| # Verify WAR file was created | |
| ls -la core/target/core.war | |
| - name: Start NemakiWare Server | |
| run: | | |
| # Copy WAR to docker directory | |
| cd docker | |
| cp ../core/target/core.war core/core.war | |
| # Start NemakiWare with docker-compose | |
| docker compose -f docker-compose-simple.yml up -d --build | |
| # Wait for server to start | |
| echo "Waiting for NemakiWare server to start..." | |
| SERVER_READY=false | |
| for i in {1..60}; do | |
| if curl -f http://localhost:8080/core/ui/; then | |
| echo "NemakiWare server is ready" | |
| SERVER_READY=true | |
| break | |
| fi | |
| echo "Waiting for server... ($i/60)" | |
| sleep 5 | |
| done | |
| # If server didn't start, dump logs for debugging | |
| if [ "$SERVER_READY" = "false" ]; then | |
| echo "=== Server failed to start, dumping Docker logs ===" | |
| docker compose -f docker-compose-simple.yml ps | |
| echo "=== Core container logs ===" | |
| docker compose -f docker-compose-simple.yml logs core --tail=500 || true | |
| echo "=== CouchDB container logs ===" | |
| docker compose -f docker-compose-simple.yml logs couchdb --tail=100 || true | |
| echo "=== Solr container logs ===" | |
| docker compose -f docker-compose-simple.yml logs solr --tail=100 || true | |
| exit 1 | |
| fi | |
| - name: Install Playwright | |
| working-directory: core/src/main/webapp/ui | |
| run: | | |
| # npm ci was already run in "Build React UI" step | |
| npx playwright install --with-deps | |
| - name: Run Playwright tests | |
| working-directory: core/src/main/webapp/ui | |
| run: | | |
| # Set base URL for tests | |
| export PLAYWRIGHT_BASE_URL=http://localhost:8080 | |
| # Run all tests | |
| npx playwright test --reporter=github | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: core/src/main/webapp/ui/playwright-report/ | |
| retention-days: 30 | |
| - name: Upload test screenshots | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-screenshots | |
| path: core/src/main/webapp/ui/test-results/ | |
| retention-days: 30 | |
| - name: Cleanup | |
| if: always() | |
| run: | | |
| # Stop docker-compose services | |
| cd docker | |
| docker compose -f docker-compose-simple.yml down | |
| docker system prune -f | |
| test-summary: | |
| name: Test Summary | |
| runs-on: ubuntu-latest | |
| needs: ui-tests | |
| if: always() | |
| steps: | |
| - name: Report Test Results | |
| run: | | |
| if [ "${{ needs.ui-tests.result }}" == "success" ]; then | |
| echo "✅ All UI tests passed successfully!" | |
| echo "🎉 NemakiWare React UI is working correctly" | |
| else | |
| echo "❌ Some UI tests failed" | |
| echo "📋 Check the test results and screenshots in the artifacts" | |
| exit 1 | |
| fi |