docs: add work log checkpoint policy #102
Workflow file for this run
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: UET Platform CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| # ==================== Rust Backend ==================== | |
| rust-check: | |
| name: Rust Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Detect Rust workspace | |
| id: rust-workspace | |
| run: | | |
| if [ -f Cargo.toml ]; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| echo "No root Cargo.toml found; skipping Rust checks for this corpus-only checkout." | |
| fi | |
| - name: Install Rust | |
| if: steps.rust-workspace.outputs.present == 'true' | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache cargo | |
| if: steps.rust-workspace.outputs.present == 'true' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Check formatting | |
| if: steps.rust-workspace.outputs.present == 'true' | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| if: steps.rust-workspace.outputs.present == 'true' | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| continue-on-error: true | |
| - name: Build | |
| if: steps.rust-workspace.outputs.present == 'true' | |
| run: cargo build --release --workspace | |
| # ==================== Next.js Frontend ==================== | |
| web-check: | |
| name: Next.js Check | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./uet_web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Detect Next.js app | |
| id: next-app | |
| working-directory: . | |
| run: | | |
| if [ -f uet_web/package-lock.json ]; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| echo "No uet_web/package-lock.json found; skipping Next.js checks for this corpus-only checkout." | |
| fi | |
| - name: Setup Node.js | |
| if: steps.next-app.outputs.present == 'true' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: './uet_web/package-lock.json' | |
| - name: Install dependencies | |
| if: steps.next-app.outputs.present == 'true' | |
| run: npm ci --legacy-peer-deps | |
| - name: Lint | |
| if: steps.next-app.outputs.present == 'true' | |
| run: npm run lint | |
| continue-on-error: true | |
| - name: Build | |
| if: steps.next-app.outputs.present == 'true' | |
| run: npm run build | |
| env: | |
| NEXT_TELEMETRY_DISABLED: 1 | |
| DATABASE_URL: "postgresql://fake:fake@localhost:5432/fake" | |
| # ==================== Python Tests ==================== | |
| python-test: | |
| name: Python Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest | |
| - name: Run Python agent tests | |
| run: | | |
| pytest uet_agents/ -v --tb=short || true | |
| continue-on-error: true | |
| # ==================== Docker Build ==================== | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: [rust-check, web-check] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Detect Dockerfiles | |
| id: dockerfiles | |
| run: | | |
| if [ -f Dockerfile.api ] || [ -f Dockerfile.web ] || [ -f Dockerfile.agents ]; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| echo "No platform Dockerfiles found; skipping Docker image builds for this corpus-only checkout." | |
| fi | |
| - name: Set up Docker Buildx | |
| if: steps.dockerfiles.outputs.present == 'true' | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build API image | |
| if: steps.dockerfiles.outputs.present == 'true' && hashFiles('Dockerfile.api') != '' | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile.api | |
| push: false | |
| tags: uet_api:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build Web image | |
| if: steps.dockerfiles.outputs.present == 'true' && hashFiles('Dockerfile.web') != '' | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile.web | |
| push: false | |
| tags: uet_web:${{ github.sha }} | |
| build-args: | | |
| DATABASE_URL=postgresql://fake:fake@localhost:5432/fake | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Build Agent image | |
| if: steps.dockerfiles.outputs.present == 'true' && hashFiles('Dockerfile.agents') != '' | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile.agents | |
| push: false | |
| tags: uet_agents:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # ==================== Deploy to Railway ==================== | |
| deploy: | |
| name: Deploy to Railway | |
| runs-on: ubuntu-latest | |
| needs: [docker-build] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Railway CLI | |
| run: npm install -g @railway/cli | |
| - name: Deploy API | |
| run: railway up --service uet-api | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }} | |
| continue-on-error: true | |
| - name: Deploy Web | |
| run: railway up --service uet-web | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_WEB_TOKEN }} | |
| continue-on-error: true |