forked from kivy-garden/garden.iconfonts
-
Notifications
You must be signed in to change notification settings - Fork 2
71 lines (69 loc) · 2.47 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: build
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request_target:
branches: [ master ]
paths:
- '**.py'
- '**/poetry.lock'
- '**/pyproject.toml'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7]
os: [ubuntu-latest, windows-latest]
defaults:
run:
shell: bash
name: python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2.3.3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: setting up python ${{ matrix.python-version }}
uses: actions/setup-python@v2.1.4
with:
python-version: ${{ matrix.python-version }}
- name: set pip cache dir
run: echo "::set-env name=pip-cache::$(pip cache dir)"
- name: caching pip storage
uses: actions/cache@v2.1.2
with:
path: ${{ env.pip-cache }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/poetry.lock') }}-${{ github.event_name }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/poetry.lock') }}
${{ runner.os }}-${{ matrix.python-version }}-pip
- name: installing poetry
run: |
pip install poetry
pip install poetry-dynamic-versioning
- name: "set poetry cache dir"
run: |
echo "::set-env name=poetry-cache::$(poetry config cache-dir)"
echo "::set-env name=poetry-version::$(poetry --version | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')"
- name: caching poetry environment
uses: actions/cache@v2.1.2
with:
path: ${{ env.poetry-cache }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ env.poetry-version }}-${{ hashFiles('**/poetry.lock') }}-${{ github.event_name }}
- name: installing dependencies
run: poetry install -n -vv --no-ansi
- name: running tests
run: poetry run green -vv
- name: building
run: poetry build -n -vv --no-ansi
- name: generate coverage xml
run: poetry run coverage xml
- name: uploading coverage to codecov
uses: codecov/codecov-action@v1.0.13
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: python ${{ matrix.python-version }} on ${{ runner.os }}