forked from DataDog/integrations-core
-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (73 loc) · 2.53 KB
/
Copy pathmeasure-disk-usage.yml
File metadata and controls
87 lines (73 loc) · 2.53 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
80
81
82
83
84
85
86
87
name: Measure Disk Usage
run-name: "Measure Disk Usage [${{ github.event.workflow_run.head_sha }}]"
on:
workflow_run:
workflows: ['Resolve Dependencies and Build Wheels']
types:
- completed
env:
PYTHON_VERSION: "3.13"
jobs:
measure-disk-usage:
runs-on: ubuntu-22.04
permissions:
contents: read
actions: read
# needed for dd-sts
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Get Datadog credentials
id: dd-sts
uses: DataDog/dd-sts-action@2e8187910199bd93129520183c093e19aa585c75 # v1.0.0
with:
policy: integrations-core-api-key
- name: Install ddev
run: |
pip install -e ./datadog_checks_dev[cli]
pip install -e ./ddev
- name: Configure ddev
run: |
ddev config override
- name: Define command
id: cmd
env:
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
EVENT_NAME: ${{ github.event.workflow_run.event }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
cmd="ddev -v size status --commit \"$HEAD_SHA\" --format json"
if [ "$EVENT_NAME" = "push" ] && [ "$HEAD_BRANCH" = "master" ]; then
cmd="$cmd --to-dd-key ${{ steps.dd-sts.outputs.api_key }}"
fi
echo "cmd=$cmd" >> $GITHUB_OUTPUT
- name: Measure disk usage (Uncompressed)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Running for uncompressed sizes"
${{ steps.cmd.outputs.cmd }}
- name: Measure disk usage (Compressed)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Running for compressed sizes"
${{ steps.cmd.outputs.cmd }} --compressed
- name: Upload JSON uncompressed sizes artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: status_uncompressed.json
path: status_uncompressed.json
if-no-files-found: error
- name: Upload JSON compressed sizes artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: status_compressed.json
path: status_compressed.json
if-no-files-found: error