-
Notifications
You must be signed in to change notification settings - Fork 52
59 lines (57 loc) · 2.03 KB
/
reusable-python-test.yml
File metadata and controls
59 lines (57 loc) · 2.03 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
55
56
57
58
59
name: Reusable Python Testing Workflow
on:
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
python-versions:
description: 'JSON array of Python versions to test against'
required: false
type: string
default: '["3.8", "3.12"]'
platforms:
description: 'JSON array of platforms to run tests on'
required: false
type: string
default: '["ubuntu-22.04", "ubuntu-latest", "macos-latest"]'
matrix-exclude:
description: 'JSON array of matrix combinations to exclude'
required: false
type: string
default: '[{"platform": "macos-latest", "python-version": "3.8"}, {"platform": "ubuntu-latest", "python-version": "3.8"}, {"platform": "ubuntu-22.04", "python-version": "3.12"}]'
secrets:
PIPELINE_GITHUB_APP_ID:
required: false
PIPELINE_GITHUB_APP_PRIVATE_KEY:
required: false
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(inputs.python-versions) }}
platform: ${{ fromJSON(inputs.platforms) }}
exclude: ${{ fromJSON(inputs.matrix-exclude) }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
with:
repository: DataDog/datadog-api-client-python
ref: ${{ inputs.target-branch || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4.9.1
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools build
- name: Install
run: pip install --disable-pip-version-check -e .[tests]
- name: Test
run: ./run-tests.sh
shell: bash