Skip to content

Commit

Permalink
Fix CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
ManiMozaffar committed Apr 28, 2024
1 parent 1c3d6cb commit b9a46e3
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 30 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ jobs:
with:
node-version: 18

- run: pip install -r src/python-fastui/requirements/all.txt
- run: pip install src/python-fastui
- run: pip install pdm==2.12.4

- run: make install

- run: make lint

- run: npm install

Expand Down Expand Up @@ -69,17 +72,25 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- run: pip install -r src/python-fastui/requirements/test.txt
- run: pip install -r src/python-fastui/requirements/pyproject.txt
- run: pip install -e src/python-fastui
- run: pip install pdm==2.12.4

- run: make install

- run: make testcov

- run: make testcov-report

- run: coverage run -m pytest src
# display coverage and fail if it's below 80%, which shouldn't happen
- run: coverage report --fail-under=80
- run: make typecheck

# ci on demo for 3.11 and 3.12, these ops are intentionally omitted, reason is that it's using 3.11 and 3.12 syntax
- if: matrix.python-version == '3.11' || matrix.python-version == '3.12'
run: make lint-demo

- if: matrix.python-version == '3.11' || matrix.python-version == '3.12'
run: make typecheck-demo

# test demo on 3.11 and 3.12, these tests are intentionally omitted from coverage
- if: matrix.python-version == '3.11' || matrix.python-version == '3.12'
run: pytest demo/tests.py
run: make test-demo

- run: coverage xml

Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,37 @@ format:
.PHONY: lint
lint:
cd src/python-fastui && pdm run ruff check .

.PHONY: lint-demo
lint-demo:
cd demo && pdm run ruff check .


.PHONY: typecheck
typecheck:
cd src/python-fastui && pdm run pyright fastui

.PHONY: typecheck-demo
typecheck-demo:
cd demo && pdm run pyright src


.PHONY: test
test:
cd src/python-fastui && pdm run coverage run -m pytest tests
cd demo && pdm run coverage run -m pytest tests

.PHONY: test-demo
test-demo:
cd demo && pdm run pytest tests

.PHONY: testcov
testcov: test
cd src/python-fastui && pdm run coverage html

.PHONY: testcov-report
testcov-report:
cd src/python-fastui && pdm run coverage report --fail-under=80

.PHONY: typescript-models
typescript-models:
fastui generate fastui:FastUI src/npm-fastui/src/models.d.ts
Expand Down

0 comments on commit b9a46e3

Please sign in to comment.