forked from finopsfoundation/focus_converters
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.54 KB
/
unittest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Unittest
on:
push:
branches:
- main
- dev
- issue/**
pull_request:
branches:
- main
- dev
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
steps:
- uses: actions/checkout@v3
- name: Copy converter_base to current directory Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
xcopy /E /I /Y focus_converter_base\* .\
- name: Copy converter_base to current directory Linux, MacOS
if: ${{ matrix.os != 'windows-latest' }}
run: |
cp -r focus_converter_base/* ./
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
poetry lock
- 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') }}-${{ matrix.os }}-${{ matrix.python-version }}
- name: Install dependencies
run: |
poetry install
- name: Test with pytest
run: |
poetry run pytest tests/