-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.28 KB
/
test.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
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
80
81
82
83
name: ci
on:
- push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install package
run: |
pip install pip-tools>=6.2.0
pip-sync requirements.txt dev-requirements.txt
pip install .
- name: Run commit-blocking lint checks
run: |
# Run pre-commit hooks. We have to be a little careful here with
# pip-compile: if we ran it with --all-files, it would run
# pip-compile on every pull, which would update the pinned
# dependencies if any have changed - even if the requirements.in
# files are unchanged.
#
# Run everything except pip-compile against all files
SKIP=pip-compile pre-commit run --all-files
# Run pip-compile - but only if requirements.in or
# dev-requirements.in have changed in this pull request's diff.
pre-commit run pip-compile --from-ref=$GITHUB_BASE_REF --to-ref=$GITHUB_HEAD_REF
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install package
run: |
pip install pip-tools>=6.2.0
pip-sync requirements.txt dev-requirements.txt
pip install .
- name: Run unit tests
run: pytest
integration-test:
runs-on: ubuntu-latest
concurrency: integration-test
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up cloud SDK
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Install package
run: |
pip install pip-tools>=6.2.0
pip-sync requirements.txt dev-requirements.txt
pip install .
- name: Run integration tests
run: pytest
env:
ALERTDB_TEST_GCP_PROJECT: ${{ secrets.GCP_PROJECT_ID }}