Skip to content

Feat remove upper bound and clean up #11

Feat remove upper bound and clean up

Feat remove upper bound and clean up #11

Workflow file for this run

name: Test and Lint
on:
pull_request:
push:
branches:
- main
env:
PROJECT_NAME: rejx
PYTHON_VERSION: 3.10.10
POETRY_VERSION: 1.7.1
jobs:
test_and_lint:
name: Lint and Test
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-keys.outputs.cache-key }}
steps:
- uses: actions/checkout@v4
###################################################################
# #
# Setup Project #
# #
###################################################################
- name: Setup Justfile
uses: extractions/setup-just@v1
- name: Check justfile linting
run: 'just --unstable --fmt --check || "justfile is not formatted!\nrun: `just fmt` and commit again"'
- name: Setup SSH agent and key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.GH_DEPLOY_KEY_ML_UTILS }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
- name: Setup Poetry for Python
uses: abatilo/actions-poetry@v2
with:
python-version: ${{ env.POETRY_VERSION }}
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: just setup cicd
###################################################################
# #
# Linting and Format #
# #
###################################################################
- name: Lint code
run: just lint
###################################################################
# #
# Testing #
# #
###################################################################
- name: Run unit test
run: just test
###################################################################
# #
# CI/CD Bots #
# #
###################################################################
# https://pypi.org/project/pytest-md-report/
- name: Run tests with reports
run: poetry run pytest --md-report --md-report-flavor gfm --md-report-output report.md