docs: add release and license badges #5
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 (for Atmosphere Maven build) | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Build Atmosphere (dependency) | |
| run: | | |
| git clone --depth 1 https://github.com/Atmosphere/atmosphere.git /tmp/atmosphere | |
| cd /tmp/atmosphere | |
| ./mvnw -B install -Pfastinstall -pl modules/cpr,modules/spring-boot-starter -am | |
| - name: Set up JDK 25 (for JavaClaw + plugin) | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 25 | |
| distribution: 'oracle' | |
| - name: Build JavaClaw base (dependency) | |
| run: | | |
| git clone --depth 1 https://github.com/jobrunr/JavaClaw.git /tmp/JavaClaw | |
| cd /tmp/JavaClaw | |
| ./gradlew :base:jar | |
| mkdir -p ~/.m2/repository/ai/javaclaw/base/1.0.0-SNAPSHOT | |
| cp base/build/libs/base-*.jar ~/.m2/repository/ai/javaclaw/base/1.0.0-SNAPSHOT/base-1.0.0-SNAPSHOT.jar | |
| cat > ~/.m2/repository/ai/javaclaw/base/1.0.0-SNAPSHOT/base-1.0.0-SNAPSHOT.pom << 'XMLEOF' | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project><modelVersion>4.0.0</modelVersion> | |
| <groupId>ai.javaclaw</groupId><artifactId>base</artifactId><version>1.0.0-SNAPSHOT</version> | |
| </project> | |
| XMLEOF | |
| - name: Build plugin | |
| run: ./gradlew build | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: javaclaw-atmosphere | |
| path: build/libs/*.jar | |
| e2e: | |
| name: E2E Tests | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Build Atmosphere | |
| run: | | |
| git clone --depth 1 https://github.com/Atmosphere/atmosphere.git /tmp/atmosphere | |
| cd /tmp/atmosphere | |
| ./mvnw -B install -Pfastinstall -pl modules/cpr,modules/spring-boot-starter -am | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 25 | |
| distribution: 'oracle' | |
| - name: Build JavaClaw with Atmosphere plugin | |
| run: | | |
| git clone --depth 1 https://github.com/jobrunr/JavaClaw.git /tmp/JavaClaw | |
| cd /tmp/JavaClaw | |
| # Add atmosphere plugin | |
| mkdir -p plugins/atmosphere/src/main/java plugins/atmosphere/src/main/resources | |
| cp -r $GITHUB_WORKSPACE/src/main/java/* plugins/atmosphere/src/main/java/ | |
| cp -r $GITHUB_WORKSPACE/src/main/resources/* plugins/atmosphere/src/main/resources/ | |
| cp $GITHUB_WORKSPACE/.github/workflows/javaclaw-plugin-build.gradle plugins/atmosphere/build.gradle | |
| # Register plugin | |
| echo "include 'plugins:atmosphere'" >> settings.gradle | |
| # Add mavenLocal + plugin dep | |
| sed -i "s|mavenCentral()|mavenLocal()\n mavenCentral()|" build.gradle | |
| sed -i "s|implementation project(':plugins:brave')|implementation project(':plugins:brave')\n implementation project(':plugins:atmosphere')|" app/build.gradle | |
| # Enable synthetic LLM | |
| echo -e "atmosphere:\n test:\n synthetic-llm: true\nagent:\n onboarding:\n completed: true" > app/src/main/resources/application.private.yaml | |
| # Replace chat template | |
| cp $GITHUB_WORKSPACE/src/main/resources/templates/chat.html.peb app/src/main/resources/templates/chat.html.peb | |
| # Add atmosphere config | |
| sed -i '/^management:/i atmosphere:\n servlet-path: /atmosphere/*\n broadcaster-cache-class: org.atmosphere.cache.UUIDBroadcasterCache\n' app/src/main/resources/application.yaml | |
| # Boot the app | |
| ./gradlew :app:bootRun & | |
| BOOT_PID=$! | |
| # Wait for startup | |
| for i in $(seq 1 60); do | |
| if curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/chat 2>/dev/null | grep -q 200; then | |
| echo "JavaClaw started" | |
| break | |
| fi | |
| sleep 2 | |
| done | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install Playwright | |
| working-directory: e2e | |
| run: | | |
| npm ci | |
| npx playwright install chromium --with-deps | |
| - name: Run E2E tests | |
| working-directory: e2e | |
| run: npx playwright test --reporter=github | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: e2e/test-results/ |