ConvAssist Refactor #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Unit Tests | |
on: | |
push: | |
branches: [ "main", "covassist_cleanup" ] | |
pull_request: | |
branches: [ "main", "covassist_cleanup" ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install poetry | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project false | |
poetry config virtualenvs.path .virtualenvs | |
- name: Poetry Version | |
id: poetry-version | |
run: echo "::set-output name=version::$(poetry --version | grep -oP '[\d\.]+')" | |
- name: Cache Poetry virtualenv | |
uses: actions/cache@v2 | |
id: cache | |
with: | |
path: .virtualenvs | |
key: ${{ inputs.os }}-${{ inputs.python-version }}-poetry-${{ steps.poetry-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
${{ inputs.os }}-${{ inputs.python-version }}-poetry-${{ steps.poetry-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
poetry install -E test | |
shell: bash | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Test with pytest | |
run: | | |
pytest | |
shell: bash |