Skip to content

Commit

Permalink
Create ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bufanoc authored Dec 23, 2024
1 parent 6dfab22 commit 5eb5b4a
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black isort
cd frontend && npm ci
- name: Check Python formatting
run: |
black --check backend
isort --check-only backend
flake8 backend
- name: Check JavaScript formatting
working-directory: frontend
run: |
npm run lint
test:
needs: lint
runs-on: ubuntu-22.04

services:
ovn:
image: ovn/ovn-controller-vtep
ports:
- 6641:6641
- 6642:6642

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
cd frontend && npm ci
- name: Run backend tests
run: |
pytest backend/tests/ --cov=backend --cov-report=xml
- name: Run frontend tests
working-directory: frontend
run: |
npm test -- --coverage

0 comments on commit 5eb5b4a

Please sign in to comment.