forked from DataDog/datadog-api-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 2.04 KB
/
test.yml
File metadata and controls
54 lines (51 loc) · 2.04 KB
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
name: Run Tests
on:
pull_request:
branches:
- master
jobs:
pre-commit:
runs-on: ubuntu-latest
if: false == startsWith(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && !contains(github.event.pull_request.labels.*.name, 'ci/skip/pre-commit')
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- name: Install pre-commit
run: python -m pip install pre-commit
- name: set PY
run: echo "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --all-files --source ${{ github.event.pull_request.base.sha }} --origin ${{ github.event.pull_request.head.sha }} --show-diff-on-failure --color=always
test:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
platform: [ubuntu-latest, macos-latest] # windows-latest
# test only latest version on macos and windows
exclude:
- platform: macos-latest
python-version: 3.6
- platform: macos-latest
python-version: 3.7
# TODO enable once dd-trace-py is updated
# - platform: windows-latest
# python-version: 3.6
# - platform: windows-latest
# python-version: 3.7
runs-on: ${{ matrix.platform }}
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: pip install --disable-pip-version-check -e .[tests]
- name: Test
run: ./run-tests.sh
shell: bash