Repository navigation
56 lines (54 loc) · 2.08 KB
/
Copy pathreusable-python-test.yml
File metadata and controls
56 lines (54 loc) · 2.08 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
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.10", "3.11", "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.10"}, {"platform": "ubuntu-latest", "python-version": "3.10"}, {"platform": "macos-latest", "python-version": "3.11"}, {"platform": "ubuntu-latest", "python-version": "3.11"}, {"platform": "ubuntu-22.04", "python-version": "3.12"}]'
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: DataDog/datadog-api-client-python
ref: ${{ inputs.target-branch || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
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
env:
DD_USE_GENERATED_TESTS: "true"