-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
74 lines (64 loc) · 2.5 KB
/
backend-test-py3.6.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
name: backend [py3.6]
on:
push:
branches:
- master
- releases/**
pull_request:
jobs:
test:
runs-on: ubuntu-16.04
timeout-minutes: 30
strategy:
matrix:
instance: [0, 1, 2]
env:
MIGRATIONS_TEST_MIGRATE: 1
steps:
- uses: actions/checkout@v2
# If we make these jobs "required" to merge on GH, then on every PR, GitHub automatically
# creates a status check in the "pending" state. This means that the workflow needs to run
# for every PR in order to update the status checks.
#
# In order to optimize CI usage, we want the tests to only run when python files change,
# since frontend changes should have no effect on these test suites. We cannot use GH workflow
# path filters because entire workflow would be skipped vs skipping individual jobs which
# would still allow this status check to pass.
- name: Check for python file changes
uses: getsentry/paths-filter@v2
id: changes
with:
token: ${{ github.token }}
filters: .github/file-filters.yml
- name: Set python version output
id: python-version
if: steps.changes.outputs.backend == 'true'
run: |
echo "::set-output name=python-version::$(awk 'FNR == 2' .python-version)"
# Until GH composite actions can use `uses`, we need to setup python here
- uses: actions/setup-python@v2
if: steps.changes.outputs.backend == 'true'
with:
python-version: ${{ steps.python-version.outputs.python-version }}
- name: Setup pip
uses: ./.github/actions/setup-pip
if: steps.changes.outputs.backend == 'true'
id: pip
- name: pip cache
uses: actions/cache@v2
if: steps.changes.outputs.backend == 'true'
with:
path: ${{ steps.pip.outputs.pip-cache-dir }}
key: ${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}-${{ hashFiles('**/requirements-*.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ steps.python-version.outputs.python-version }}
- name: Setup sentry env
uses: ./.github/actions/setup-sentry
if: steps.changes.outputs.backend == 'true'
id: setup
with:
python: 3
- name: Run backend test [py3.6] (${{ steps.setup.outputs.matrix-instance-number }} of ${{ strategy.job-total }})
if: steps.changes.outputs.backend == 'true'
run: |
make travis-test-postgres