-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.71 KB
/
tests.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
name: Tests
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
tests:
strategy:
matrix:
os: ['Windows', 'macOS', 'Ubuntu']
python-version: ['3.8', '3.9', '3.10']
include:
- os: Windows
image: windows-latest
- os: macOS
image: macos-latest
- os: Ubuntu
image: ubuntu-latest
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.image }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install Poetry
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Update PATH
if: ${{ matrix.os != 'Windows' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Update PATH (Windows)
if: ${{ matrix.os == 'Windows' }}
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Install pytest annotation plugin
run: poetry run pip install pytest-github-actions-annotate-failures
- name: Run tests with coverage
if: ${{ matrix.os != 'Ubuntu' }}
run: poetry run pytest --cov=diskfs tests/
- name: Run tests with coverage (Ubuntu)
if: ${{ matrix.os == 'Ubuntu' }}
run: sudo -E env "PATH=$PATH" poetry run pytest --cov=diskfs tests/
- name: Upload coverage data to Coveralls
run: poetry run coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}