Skip to content

Measure Disk Usage [32a22f7e83f6efa333622b2f897b6e136ceb092e] #772

Measure Disk Usage [32a22f7e83f6efa333622b2f897b6e136ceb092e]

Measure Disk Usage [32a22f7e83f6efa333622b2f897b6e136ceb092e] #772

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
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: 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 ${{ secrets.DD_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