Measure Disk Usage [4adb68d2b4a835adbe189e9aa29b2eab74eb1e60] #3635
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: status_uncompressed.json | |
| path: status_uncompressed.json | |
| if-no-files-found: error | |
| - name: Upload JSON compressed sizes artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: status_compressed.json | |
| path: status_compressed.json | |
| if-no-files-found: error |