-
Notifications
You must be signed in to change notification settings - Fork 52
79 lines (71 loc) · 2.7 KB
/
test.yml
File metadata and controls
79 lines (71 loc) · 2.7 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Run Tests
permissions:
contents: read
env:
GIT_AUTHOR_EMAIL: "packages@datadoghq.com"
GIT_AUTHOR_NAME: "ci.datadog-api-spec"
on:
pull_request:
branches:
- master
schedule:
- cron: "0 2 * * *"
concurrency:
group: unit-${{ github.head_ref }}
cancel-in-progress: true
jobs:
pre-commit:
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/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-pre-commit.yml
permissions:
id-token: write
contents: read
with:
enable-commit-changes: true
test:
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/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-python-test.yml
with:
python-versions: '["3.8", "3.12"]'
platforms: '["ubuntu-22.04", "ubuntu-latest", "macos-latest"]'
matrix-exclude: '[{"platform": "macos-latest", "python-version": "3.8"}, {"platform": "ubuntu-latest", "python-version": "3.8"}, {"platform": "ubuntu-22.04", "python-version": "3.12"}]'
examples:
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/')) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reusable-examples.yml
with:
examples-script: './check-examples.sh'
python-version: '3.12'
report:
runs-on: ubuntu-latest
permissions:
id-token: write
if: always() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
needs:
- test
- examples
steps:
- name: Get dd-octo-sts token
id: octo-sts
uses: DataDog/dd-octo-sts-action@96a25462dbcb10ebf0bfd6e2ccc917d2ab235b9a # v1.0.4
with:
scope: DataDog/datadog-api-spec
policy: datadog-api-client-python.github.post-status-check.pull-request
- name: Post status check
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.octo-sts.outputs.token }}
repo: datadog-api-spec
status: ${{ (needs.test.result == 'cancelled' || needs.examples.result == 'cancelled') && 'pending' || (needs.test.result == 'success' && needs.examples.result == 'success') && 'success' || 'failure' }}
context: master/unit