-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (47 loc) · 1.4 KB
/
python-test.yml
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
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
POETRY_VERSION: "<1.4.0"
jobs:
build:
if: |
! contains(github.event.head_commit.message, 'docs') &&
! contains(github.event.head_commit.message, 'chore')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ env.POETRY_VERSION }}
- name: Cache Packages
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Install dependencies
run: |
python -m pip install "poetry${{ env.POETRY_VERSION }}" poethepoet
poetry install --without dev
- name: Build and install the library
run: |
poe build
- name: Test with ward
run: |
poe test