-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.07 KB
/
automation-api.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Automation API
on: push
env:
OPENAI_API_KEY: invalid-openai-api-key-for-ci
OPENAI_ORG_ID: invalid-openai-org-id-for-ci
defaults:
run:
working-directory: automation-api
jobs:
lint:
name: "(automation-api) Lint"
runs-on: ubuntu-latest
strategy:
matrix:
python: [ 3.11 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Load cached pre-commit environment
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{matrix.python}}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install pre-commit
run: pip install pre-commit
- name: Lint
run: pre-commit run --all-files
test:
name: "(automation-api) Test"
runs-on: ubuntu-latest
strategy:
matrix:
python: [ 3.11 ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Load cached Poetry installation
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('.github/workflows/automation-api.yaml') }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: automation-api/.venv
key: venv-${{ runner.os }}-${{matrix.python}}-${{ hashFiles('automation-api/poetry.lock') }}
- name: Install dependencies
run: poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Run tests
run: poetry run poe pytest