diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..2ad8a2712 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + pull_request: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + + - name: Lint + run: | + black --check juno-agent/ src/juno || true + flake8 juno-agent/ src/juno || true + + - name: Type check + run: | + mypy juno-agent/ src/juno || true + + - name: Test + run: | + pytest -v --cov=juno-agent --cov=src/juno --cov-report=xml + + - name: Upload coverage to Codecov + if: always() + uses: codecov/codecov-action@v3 + with: + files: ./coverage.xml + fail_ci_if_error: false diff --git a/requirements-dev.txt b/requirements-dev.txt index 564c1a30a..7cd3c15e8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,3 +4,4 @@ black==24.4.2 flake8==7.0.0 mypy==1.10.0 pre-commit==3.7.0 +pytest-cov==6.2.1