From 3a94f5e46717dccc508390eea22af16c349d758b Mon Sep 17 00:00:00 2001 From: leahwicz <60146280+leahwicz@users.noreply.github.com> Date: Wed, 21 Sep 2022 16:42:30 -0400 Subject: [PATCH] Update model_performance.yml --- .github/workflows/model_performance.yml | 37 ++++++++++--------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/model_performance.yml b/.github/workflows/model_performance.yml index af6e709bfe2..9626ba13d96 100644 --- a/.github/workflows/model_performance.yml +++ b/.github/workflows/model_performance.yml @@ -26,13 +26,12 @@ on: # here and in the runner. Even if we use a semver library I suspect it will be rather difficult. release_id: description: '(^^ always run from main) dbt version to model (must be non-prerelease in Pypi)' - default: 9.9.9 required: true open_prs: - description: Open PRs to main and release branch? (branch name inferred from provided version) (yes/no) - default: 'no' + description: Open PRs to main and release branch? (branch name inferred from provided version) + type: boolean required: true - pull_request: # TODO: remove, just for testing purposes + # pull_request: # TODO: remove, just for testing purposes env: RUNNER_CACHE_PATH: performance/runner/target/release/runner @@ -86,7 +85,7 @@ jobs: without_v=1.2.1 # TODO: just for testing local_release_id=$without_v echo "::set-output name=release_id::$without_v" - echo "::set-output name=open_prs::yes" + echo "::set-output name=open_prs::true" fi # string manipulation to get the branch name. It can't be discovered from the github api @@ -194,7 +193,10 @@ jobs: # TODO CHANGE NUMBER OF RUNS BEFORE MERGING # TODO this isn't putting the baseline in the right directory. it's putting it one level up. - name: Run Measurement - run: mkdir ${{ github.workspace }}/performance/tmp/ && mkdir -p performance/baselines/${{ needs.latest-runner.outputs.release_id }}/ && performance/app model -v ${{ needs.latest-runner.outputs.release_id }} -b ${{ github.workspace }}/performance/baselines/ -p ${{ github.workspace }}/performance/projects/ -t ${{ github.workspace }}/performance/tmp/ -n 2 + run: | + mkdir ${{ github.workspace }}/performance/tmp/ + mkdir -p performance/baselines/${{ needs.latest-runner.outputs.release_id }}/ + performance/app model -v ${{ needs.latest-runner.outputs.release_id }} -b ${{ github.workspace }}/performance/baselines/ -p ${{ github.workspace }}/performance/projects/ -t ${{ github.workspace }}/performance/tmp/ -n 2 - name: '[DEBUG] ls baseline directory after run' run: ls -R performance/baselines/ @@ -205,11 +207,13 @@ jobs: path: performance/baselines/${{ needs.latest-runner.outputs.release_id }}/ create-pr: - if: ${{ needs.latest-runner.outputs.open_prs == 'yes' }} + name: Open PR for ${{ matrix.base-branch }} + if: ${{ needs.latest-runner.outputs.open_prs }} + # depends on `model` as a separate job so that the baseline can be committed to more than one branch # i.e. release branch and main needs: [latest-runner, model] - name: Open PR for ${{ matrix.base-branch }} + runs-on: ubuntu-latest strategy: @@ -229,7 +233,6 @@ jobs: echo "open_prs: ${{ needs.latest-runner.outputs.open_prs }}" echo "release_branch: ${{ needs.latest-runner.outputs.release_branch }}" - # explicitly checkout main - name: Checkout uses: actions/checkout@v2 with: @@ -237,14 +240,9 @@ jobs: - name: Create PR branch run: | - git log -1 git checkout -b ${{ matrix.target-branch }} git push origin ${{ matrix.target-branch }} git branch --set-upstream-to=origin/${{ matrix.target-branch }} ${{ matrix.target-branch }} - git log -1 - - - name: '[DEBUG] ls baselines before artifact download' - run: ls -R performance/baselines/ - uses: actions/download-artifact@v3 with: @@ -253,10 +251,6 @@ jobs: - name: '[DEBUG] ls baselines after artifact download' run: ls -R performance/baselines/ - - - name: '[DEBUG] git status' - run: | - git status - name: Commit baseline uses: EndBug/add-and-commit@v9 @@ -267,17 +261,14 @@ jobs: message: 'adding performance baseline for ${{ needs.latest-runner.outputs.release_id }}' branch: '${{ matrix.target-branch }}' push: 'origin origin/${{ matrix.target-branch }}' - - - name: '[DEBUG] git status' - run: git status - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: author: 'Github Build Bot ' base: ${{ matrix.base-branch }} - draft: true - title: 'Adding performance modeling for ${{needs.latest-runner.outputs.release_id}} to ${{ matrix.target-branch }}' + title: 'Adding performance modeling for ${{needs.latest-runner.outputs.release_id}} to ${{ matrix.base-branch }}' branch: '${{ matrix.target-branch }}' labels: | Skip Changelog + Performance