Skip to content

update ci/cd

update ci/cd #23

Workflow file for this run

name: Codacy Analysis
on:
# push:
# branches:
# - main
pull_request:
branches:
- main
jobs:
codacy-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.2.2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1.4.1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Install root package only
if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true'
run: poetry install --no-interaction --only-root
- name: Run tests
run: |
make test
poetry run coverage xml
- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@v1.3.0
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml