-
Notifications
You must be signed in to change notification settings - Fork 5
44 lines (42 loc) · 1.42 KB
/
python-app.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
# This workflow will check formatting with Black, install Python dependencies,
# and run tests with pytest
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# Apply this workflow when creating a pull request or pushing a commit to a PR
on: pull_request
jobs:
black-formatting-check:
name: Black formatting check
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
# This will halt the action if formatting fails
# Note: This will also fail if there are syntax errors
- uses: psf/black@stable
with:
version: "22.6.0"
run-unit-tests:
name: Run unit tests
runs-on: 'ubuntu-latest'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install venv
run: poetry install
- name: Run pytests
# This will halt the action if any of the tests fail
run: poetry run pytest -v
- name: Run rule tests
run: poetry run rct229 test -rs ashrae9012019