Skip to content

Commit

Permalink
ci: use Pantos shared Python CI
Browse files Browse the repository at this point in the history
  • Loading branch information
danut13 committed May 3, 2024
1 parent 4947be0 commit 77ac587
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 110 deletions.
29 changes: 0 additions & 29 deletions .github/actions/install-deps/action.yml

This file was deleted.

70 changes: 3 additions & 67 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Format, Lint, and Test
name: CI

on:
push:
Expand All @@ -7,69 +7,5 @@ on:
pull_request:

jobs:
Format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-deps

- name: Format
run: make format-check

Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-deps

- name: Lint
run: make lint

Sort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-deps

- name: Sort
run: make sort-check

Bandit:
name: Bandit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-deps

- name: Bandit
run: make bandit

StaticCodeAnalysis:
name: Static Code Analysis
runs-on: ubuntu-latest
needs: [Format, Lint, Sort, Bandit]
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-deps

- name: StaticCodeAnalysis
run: |
make check
UnitTest:
name: Unit Test
runs-on: ubuntu-latest
needs: [Format, Lint, Sort, Bandit]
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/install-deps

- name: Unit Test
run: |
make coverage
CI:
uses: pantos-io/ci-workflows/.github/workflows/python-ci.yml@v1
25 changes: 12 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ code: check format lint sort bandit test
check:
poetry run mypy $(PYTHON_FILES)

.PHONY: test
test:
poetry run python3 -m pytest tests
.PHONY: format
format:
poetry run yapf --in-place --recursive $(PYTHON_FILES)

.PHONY: coverage
coverage:
rm -rf .coverage
poetry run python3 -m pytest --cov-report term-missing --cov=pantos tests
.PHONY: format-check
format-check:
poetry run yapf --diff --recursive $(PYTHON_FILES)

.PHONY: lint
lint:
Expand All @@ -36,13 +35,13 @@ bandit:
bandit-check:
poetry run bandit -r $(PYTHON_FILES) --configfile=.bandit

.PHONY: format
format:
poetry run yapf --in-place --recursive $(PYTHON_FILES)
.PHONY: test
test:
poetry run python3 -m pytest tests

.PHONY: format-check
format-check:
poetry run yapf --diff --recursive $(PYTHON_FILES)
.PHONY: coverage
coverage:
poetry run python3 -m pytest --cov-report term-missing --cov=pantos tests

.PHONY: wheel
wheel:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ yapf = "0.40.1"
pre-commit = "3.3.3"

[tool.poetry.dependencies]
python = "^3.12"
python = "^3.10"
celery = "5.3.1"
Cerberus = "1.3.4"
Flask-RESTful = "0.3.10"
Expand Down

0 comments on commit 77ac587

Please sign in to comment.