-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (57 loc) · 1.66 KB
/
pytest_flake8.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
name: pytest & flake8
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
PROJECT_ID: kzs-sandbox
INSTANCE_ID: demo
DATABASE_ID: ranking
SPANNER_EMULATOR_HOST: "localhost:9010"
K_SERVICE: spanner-sqlalchemy-demo
K_REVISION: spanner-sqlalchemy-demo-00001-thx
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/share/pypoetry" >> $GITHUB_PATH
- name: Poetry Version
run: |
poetry --version
- name: Poetry Install Dependencies
run: |
poetry install --no-interaction
- name: Run Cloud Spanner emulator
run: |
docker run -d -p 9010:9010 -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0
- name: Check gcloud CLI working
run: gcloud info
- name: Set up Cloud Spanner emulator
working-directory: tests
run: |
chmod u+x spanner_emulator_setup.sh
./spanner_emulator_setup.sh
- name: Test with pytest
working-directory: tests
run: |
poetry run pytest
- name: Lint with flake8
run: |
poetry run flake8 . --count --max-line-length=120 --max-complexity=10 --show-source --statistics