luarss started CI #357
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: ORAssistant CI | |
| run-name: ${{ github.actor }} started CI | |
| on: | |
| pull_request: | |
| paths: | |
| - 'backend/**' | |
| - 'frontend/**' | |
| - 'evaluation/**' | |
| - 'Makefile' | |
| - 'docker-compose.yml' | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build-backend-docker: | |
| runs-on: self-hosted | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Setup python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup prereqs | |
| run: | | |
| make init-dev | |
| - name: Run formatting checks | |
| run: | | |
| make check | |
| - name: Run unit tests | |
| working-directory: backend | |
| run: | | |
| uv pip install huggingface_hub[cli] | |
| huggingface-cli download --repo-type dataset The-OpenROAD-Project/ORAssistant_RAG_Dataset --include source_list.json --local-dir data/ | |
| cp .env.test .env | |
| make test | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: luarss | |
| password: ${{ secrets.GH_PAT }} | |
| - name: Set lowercase repository name | |
| run: | | |
| echo "REPO_LOWER=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
| - name: Build backend Docker image with cache | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| push: false | |
| tags: ghcr.io/${{ env.REPO_LOWER }}/backend:pr-${{ github.event.pull_request.number }} | |
| cache-from: | | |
| type=registry,ref=ghcr.io/luarss/orassistant-backend:cache | |
| type=registry,ref=ghcr.io/${{ env.REPO_LOWER }}/backend:latest | |
| cache-to: type=registry,ref=ghcr.io/luarss/orassistant-backend:cache,mode=max | |
| - name: Build frontend Docker image with cache | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./frontend/nextjs-frontend | |
| push: false | |
| tags: ghcr.io/${{ env.REPO_LOWER }}/frontend:pr-${{ github.event.pull_request.number }} | |
| cache-from: | | |
| type=registry,ref=ghcr.io/luarss/orassistant-frontend:cache | |
| type=registry,ref=ghcr.io/${{ env.REPO_LOWER }}/frontend:latest | |
| cache-to: type=registry,ref=ghcr.io/luarss/orassistant-frontend:cache,mode=max |