-
-
Notifications
You must be signed in to change notification settings - Fork 79
72 lines (62 loc) · 2 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- '**'
tags-ignore:
- '*.*'
paths-ignore:
- "*.md"
- ".pre-commit-config.yaml"
- "pyproject.toml"
- "**/version.py"
env:
BUILD_POETRY_VERSION: 1.2.2
PACKAGE_NAME: evernote_backup
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Load cached Poetry installation
if: matrix.os != 'windows-latest'
uses: actions/cache@v2
with:
path: ~/.local
key: dotlocal-${{ matrix.os }}-${{ matrix.python-version }}-${{ env.BUILD_POETRY_VERSION }}
- name: Install Poetry ${{ env.BUILD_POETRY_VERSION }}
uses: snok/[email protected]
with:
version: ${{ env.BUILD_POETRY_VERSION }}
installer-parallel: false
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
shell: bash
run: poetry install --no-interaction --no-root
- name: Run tests
shell: bash
run: poetry run pytest --cov-report=xml --cov=${{ env.PACKAGE_NAME }} tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'
with:
token: ${{ secrets.CODECOV_TOKEN }}