-
Notifications
You must be signed in to change notification settings - Fork 10
51 lines (48 loc) · 1.82 KB
/
compute-scenarios.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
name: "Compute scenarios to run"
on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
scenarios:
description: "Comma-separated list of scenarios to run"
value: ${{ jobs.main.outputs.scenarios }}
scenarios_groups:
description: "Comma-separated list of scenarios groups to run"
value: ${{ jobs.main.outputs.scenarios_groups }}
jobs:
main:
runs-on: ubuntu-latest
outputs:
scenarios: ${{ steps.compute_impacted_scenarios.outputs.scenarios }}
scenarios_groups: ${{ steps.compute_impacted_scenarios.outputs.scenarios_groups }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
- name: Checkout main branch
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
ref: 'main'
path: 'original'
- name: Install runner
uses: ./.github/actions/install_runner
- name: Get scenario map
run: ./run.sh MOCK_THE_TEST --collect-only --scenario-report
- name: Get list of modified files
run: |
git fetch origin ${{ github.event.pull_request.base.sha || github.sha }}
git diff --name-only HEAD ${{ github.event.pull_request.base.sha || github.sha }} >> modified_files.txt
cat modified_files.txt
- name: Compute impacted scenario
id: compute_impacted_scenarios
run: |
source venv/bin/activate
python utils/scripts/compute_impacted_scenario.py >> $GITHUB_OUTPUT
env:
PYTHONPATH: "."
GITHUB_REF: ${{ github.ref }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_PULL_REQUEST_LABELS: ${{ toJSON(github.event.pull_request.labels) }}
TEMP_TEST: ${{ toJSON(github.doesntexists) }}