-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (50 loc) · 1.83 KB
/
build.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
# TODO: https://github.com/marketplace/actions/automatic-releases
name: Build
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: true
matrix:
python-version: [ 3.7, 3.8 ]
poetry-version: [ 1.0.10 ]
os: [ ubuntu-18.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: "Install Poetry"
uses: Gr1N/setup-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- name: "Initialize package cache"
uses: actions/cache@v1
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ matrix.os }}-poetry${{ matrix.poetry-version }}-python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ matrix.os }}-poetry${{ matrix.poetry-version }}-python${{ matrix.python-version }}
- name: Poetry install
run: poetry install
- name: Show outdated packages
run: poetry show --outdated
continue-on-error: true
- name: Test with pytest
run: poetry run pytest tests/ --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=tgtypes --cov-report=xml --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v2
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}