-
-
Notifications
You must be signed in to change notification settings - Fork 25
73 lines (58 loc) · 1.95 KB
/
ci.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
name: CI
on:
pull_request_target:
branches:
- master
jobs:
lint_and_test:
name: Linting and Testing
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
steps:
- uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup virtual environment
run: make venv
- name: Pylinting
run: make pylint
- name: Unit Tests
run: make unit_test
- name: Approve
run: echo For security reasons, all pull requests need to be approved first before running Integration tests.
integration_test:
name: Integration Testing
runs-on: ubuntu-latest
needs:
- lint_and_test
environment:
name: Integrate Pull Request
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
steps:
- uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup virtual environment
run: make venv
- name: Integration Tests
run: |
echo "$GOOGLE_APPLICATION_CREDENTIALS" > service.json
export GOOGLE_APPLICATION_CREDENTIALS=service.json
export TARGET_BIGQUERY_SCHEMA="`echo "$TARGET_BIGQUERY_SCHEMA" | tr -d "."`"
make integration_test
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
TARGET_BIGQUERY_PROJECT: ${{ secrets.TARGET_BIGQUERY_PROJECT }}
TARGET_BIGQUERY_SCHEMA: ${{ secrets.TARGET_BIGQUERY_SCHEMA }}_MR${{ github.event.number }}_${{ matrix.python-version }}