This repository was archived by the owner on Jun 26, 2023. It is now read-only.
forked from OrderedSet86/gtnh-flow
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (90 loc) · 3.96 KB
/
python-app.yml
File metadata and controls
95 lines (90 loc) · 3.96 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Testing
on:
push:
branches: ['master']
pull_request:
branches: ['master']
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
test:
strategy:
fail-fast: true
matrix:
os: [ 'Windows', 'Ubuntu' ]
py: [ '3.11' ]
runs-on: ${{ matrix.os }}-latest
name: |
GT: Flow testing on OS ${{ matrix.os }} Python ${{ matrix.py }}
steps:
# ---------------------------------------------------------------------------- #
# Check out repo and setup Python #
# ---------------------------------------------------------------------------- #
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.py }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
# ---------------------------------------------------------------------------- #
# Setup Graphviz #
# ---------------------------------------------------------------------------- #
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
# ---------------------------------------------------------------------------- #
# Install Poetry #
# ---------------------------------------------------------------------------- #
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# ---------------------------------------------------------------------------- #
# Load cached venv if exists #
# ---------------------------------------------------------------------------- #
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# ---------------------------------------------------------------------------- #
# Install dependencies #
# ---------------------------------------------------------------------------- #
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
# ---------------------------------------------------------------------------- #
# Install GT: Flow #
# ---------------------------------------------------------------------------- #
- name: Install GT Flow
run: poetry install --no-interaction
# ---------------------------------------------------------------------------- #
# Run tests #
# ---------------------------------------------------------------------------- #
- name: Run pytest for Windows
run: |
poetry run pytest --cov=./ --cov-report=xml -svv
if: ${{ matrix.os == 'Windows' }}
env:
PYTHONIOENCODING: utf-8
- name: Run pytest for Linux
run: |
poetry run pytest --cov=./ --cov-report=xml -svv
if: ${{ matrix.os != 'Windows' }}
- name: Run mypy
run: |
source $VENV
mypy src
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true