name: flask-overhead-profile
on:
  push:
    branches:
      - main
      - 'mq-working-branch**'
  pull_request:
    paths:
      - 'ddtrace/**'
      - 'scripts/profiles/flask-simple/**'
      - '.github/workflows/flask-overhead-profile.yml'

jobs:
  flask-overhead-profile:
    runs-on: ubuntu-latest
    env:
      PREFIX: ${{ github.workspace }}/prefix
    defaults:
      run:
        working-directory: ddtrace
    steps:
      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          persist-credentials: false
          path: ddtrace

      - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
        with:
          python-version: "3.10"

      - name: Setup
        run: |
          bash scripts/profiles/flask-simple/setup.sh ${PREFIX}

      - name: Run
        run: |
          bash scripts/profiles/flask-simple/run.sh ${PREFIX}

      - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        with:
          name: flask-overhead-profile
          path: ${{ github.workspace }}/prefix/artifacts
