forked from dbt-labs/dbt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,22 +233,16 @@ 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: | ||
ref: ${{ matrix.base-branch }} | ||
|
||
- 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 <[email protected]>' | ||
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 |