-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
d476445
commit d06ab9e
Showing
1 changed file
with
23 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 |
---|---|---|
|
@@ -18,45 +18,45 @@ jobs: | |
METRIQ_TOKEN: ${{ secrets.METRIQ_TOKEN}} | ||
|
||
steps: | ||
- name: Setup repository on this workflow | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install and configure Github CLI | ||
uses: cli/cli/[email protected] | ||
with: | ||
gh-version: 2 | ||
|
||
|
||
- name: Install tox | ||
run: pip install tox | ||
run: pip install tox | ||
|
||
- name: Run experiment steps in tox | ||
run: tox -ve py38 | ||
|
||
handle_new_artifacts: | ||
runs on: ubuntu-latest | ||
needs: run_experiment_steps | ||
|
||
- name: Configure Git with Bot Git Config | ||
run: | | ||
git config user.name "${{ secrets.BOT_USERNAME }}" | ||
git config user.email "${{ secrets.BOT_EMAIL }}" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for updates on result files and open new PR with Bot user | ||
run: | | ||
untracked_csv_files=$(find ./benchmarking/results/ -name '*.csv' -type f) | ||
- name: Check for new artifacts and open new PR with Bot user | ||
run: | | ||
new_csv_files=$(find ./benchmarking/results/ -name '*.csv' -type f) | ||
deleted_csv_files=$(git diff --name-only HEAD@{1} HEAD | grep -E '^../results/.*\.csv') | ||
if [ -n "$untracked_csv_files" ] || [ -n "deleted_csv_files"]; then | ||
if [ -n "$new_csv_files" ] || [ -n "deleted_csv_files"]; then | ||
git checkout -b bot-branch | ||
git add $untracked_csv_files | ||
git add $new_csv_files | ||
git rm $deleted_csv_files | ||
git commit -m "Add new result files" | ||
git push --set-upstream origin bot-branch | ||
gh pr create --base main --head bot-branch --title "Add new result files" | ||
git checkout main | ||
uses: pullreminders/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: bot-branch | ||
title: "Add new result files" | ||
else | ||
echo "No generated artifacts" | ||
fi | ||
env: | ||
BOT_USERNAME: ${{ secrets.BOT_USERNAME }} | ||
BOT_EMAIL: ${{ secrets.BOT_EMAIL }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} | ||
|
||
|