diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..055c7eed --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,34 @@ +name: codecov +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + codecov: + concurrency: + group: "${{ github.workflow }} @ ${{ github.ref }}" + cancel-in-progress: true + runs-on: ubuntu-latest + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v3 + + - name: Configure Python version + uses: actions/setup-python@v4 + with: + python-version: "3.11" + architecture: x64 + + - name: Install + run: make install-test + + - name: Run tests and collect coverage + run: make test-cov + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + diff --git a/codecov b/codecov new file mode 100755 index 00000000..38ebfdc4 Binary files /dev/null and b/codecov differ diff --git a/makefile b/makefile index 2d2c17a4..876df776 100644 --- a/makefile +++ b/makefile @@ -3,6 +3,9 @@ SRC_PATH = personal_mnemonic_medium deploy: ./docker_cmd.sh +install-test: + pip install --upgrade .[dev,tests] + install-dev: pip install --upgrade .[dev] @@ -13,6 +16,9 @@ install: test: ## Run tests pytest personal_mnemonic_medium/tests +test-cov: ## Run tests with coverage + pytest --cov=personal_mnemonic_medium --cov-report=term-missing personal_mnemonic_medium/tests + lint: ## Format code ruff format . ruff . --fix \