Skip to content

Measure Disk Usage [229d134cfd57b71db81165c74ed99925e2d9f47b] #12843

Measure Disk Usage [229d134cfd57b71db81165c74ed99925e2d9f47b]

Measure Disk Usage [229d134cfd57b71db81165c74ed99925e2d9f47b] #12843

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"
INTEGRATIONS_WHEELS_STORAGE: "stable"
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
uses: ./.github/actions/setup-ddev
with:
install-mode: local
cache-profile: local-ddev-base
- 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