Update ci.yaml
Browse files12345678910111213141516171819202122231 unmodified line25262728293031323334353637383940414243444546474849# ci.yamlname: CIon:push:branches: [ main ]pull_request:branches: [ main ]jobs:lint-and-test:runs-on: ubuntu-lateststrategy:matrix:python-version: [3.9, 3.10, 3.11]steps:- uses: actions/checkout@v3- name: Set up Pythonuses: actions/setup-python@v4with:python-version: ${{ matrix.python-version }}1 unmodified linerun: |python -m pip install --upgrade pippip install -r requirements.txtpip install flake8 pytest- name: Lint with flake8run: |flake8 .- name: Run pytestrun: |pytest --maxfail=1 --disable-warnings -qbuild-and-deploy:needs: lint-and-testruns-on: ubuntu-latestif: github.ref == 'refs/heads/main' && github.event_name == 'push'steps:- uses: actions/checkout@v3- name: Build Docker imagerun: |docker build -t anycoder:latest .# You could add deployment steps here (e.g., push to registry, deploy to cloud)123456789101112131415161718192021222324252627282930313233341 unmodified line36373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100# .github/workflows/ci.yaml# --------------------------------------------------------------# AnyCoder AI – Continuous Integration pipeline# --------------------------------------------------------------name: CIon:push:branches: [main]pull_request:branches: [main]env:PYTHON_VERSION_MATRIX: "3.9,3.10,3.11"DOCKER_IMAGE: anycoder:latestjobs:# --------------------------------------------------------------# 1. Lint & Test (Python)# --------------------------------------------------------------lint-and-test:runs-on: ubuntu-lateststrategy:matrix:python-version: [${{ fromJSON(env.PYTHON_VERSION_MATRIX) }}]steps:- uses: actions/checkout@v4- name: Set up Python ${{ matrix.python-version }}uses: actions/setup-python@v5with:python-version: ${{ matrix.python-version }}1 unmodified linerun: |python -m pip install --upgrade pippip install -r requirements.txtpip install flake8 pytest nbmake# style / typing (optional)pip install black==24.2.0 mypy- name: Lint with flake8 & black‑checkrun: |black --check .flake8 .- name: Run pytestrun: |pytest -q- name: Validate notebooks with nbmakerun: |pytest --nbmake notebooks/# --------------------------------------------------------------# 2. Build static front‑end (HTML/CSS/JS) – no node needed# --------------------------------------------------------------build-frontend:runs-on: ubuntu-latestneeds: lint-and-teststeps:- uses: actions/checkout@v4- name: Archive static assetsuses: actions/upload-artifact@v4with:name: static-assetspath: |static/index.htmlstatic/style.cssstatic/index.js# --------------------------------------------------------------# 3. Docker build & (optional) publish# --------------------------------------------------------------build-and-deploy:runs-on: ubuntu-latestneeds:- lint-and-test- build-frontendif: github.ref == 'refs/heads/main' && github.event_name == 'push'steps:- uses: actions/checkout@v4- name: Build Docker imagerun: |docker build -t ${{ env.DOCKER_IMAGE }} .# Optionally push to GHCR / DockerHub# - name: Log in to registry# uses: docker/login-action@v3# with:# registry: ghcr.io# username: ${{ github.actor }}# password: ${{ secrets.GHCR_TOKEN }}## - name: Push image# run: |# docker tag ${{ env.DOCKER_IMAGE }} ghcr.io/${{ github.repository }}:latest# docker push ghcr.io/${{ github.repository }}:latest
ci.yaml+65-14