generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 4
62 lines (59 loc) · 1.61 KB
/
testPython.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
54
55
56
57
58
59
60
61
62
name: Test
on:
workflow_dispatch:
pull_request:
branches:
- "**"
push:
branches:
- main
env:
TEST_RUNNER_PYTHON_VERSION: 3.9
jobs:
unit-test-python-functions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python ${{env.TEST_RUNNER_PYTHON_VERSION}}
uses: actions/setup-python@v4
with:
python-version: ${{env.TEST_RUNNER_PYTHON_VERSION}}
cache: pip
- name: Install Pytest
run: pip install pytest
- name: Install dependencies
working-directory: ./serverless-functions
run: |
pip install -r requirements.txt
- name: Run unit tests for serverless-functions
working-directory: ./serverless-functions
run: |
python -m pytest
code-check-python:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup python ${{env.TEST_RUNNER_PYTHON_VERSION}}
uses: actions/setup-python@v4
with:
python-version: ${{env.TEST_RUNNER_PYTHON_VERSION}}
cache: pip
- name: Install dependencies
run: |
pip install -U pip
pip install black flake8
- name: Check format (black)
run: |
black --check --verbose .
- name: Check style (flake8)
run: |
flake8
ensure-clean-notebooks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check notebook cleanliness
uses: ResearchSoftwareActions/EnsureCleanNotebooksAction@1.1