-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (50 loc) · 1.99 KB
/
validate-python.yaml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Validate Python
on:
pull_request:
branches:
- master
paths:
- '.github/workflows/validate-python.yml'
- 'tools/data-model-exporter/**'
jobs:
python-validation:
runs-on: ubuntu-latest
env:
ENV: test
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Poetry
uses: snok/[email protected]
- name: Cache dependencies
uses: actions/cache@v2
env:
cache-name: cache-poetry
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./tools/data-model-exporter/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
id: dependencies
run: poetry install
working-directory: ${{ github.workspace }}/tools/data-model-exporter
- name: Enforce coding style guide
run: poetry run autopep8 --recursive --diff --exit-code .
working-directory: ${{ github.workspace }}/tools/data-model-exporter
if: always() && steps.dependencies.outcome == 'success' # run all three checks, even if a prior check fails
- name: Check static types
run: poetry run mypy
working-directory: ${{ github.workspace }}/tools/data-model-exporter
if: always() && steps.dependencies.outcome == 'success' # run all three checks, even if a prior check fails
- name: Run test suite
run: poetry run pytest
working-directory: ${{ github.workspace }}/tools/data-model-exporter
if: always() && steps.dependencies.outcome == 'success' # run all three checks, even if a prior check fails