fix: sync all versions to 0.9.0, update project structure docs and re… #78
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: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache cargo | |
| 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 | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| continue-on-error: true | |
| - name: Build | |
| 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: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: './uet_web/package-lock.json' | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| - name: Lint | |
| run: npm run lint | |
| continue-on-error: true | |
| - name: Build | |
| 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: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build API image | |
| 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 | |
| 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 | |
| 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 |