|
15 | 15 | jobs: |
16 | 16 | upload-sdgym-benchmark: |
17 | 17 | runs-on: ubuntu-latest |
| 18 | + |
18 | 19 | steps: |
19 | 20 | - uses: actions/checkout@v4 |
20 | 21 | with: |
21 | 22 | fetch-depth: 0 |
| 23 | + |
22 | 24 | - name: Set up latest Python |
23 | 25 | uses: actions/setup-python@v5 |
24 | 26 | with: |
25 | 27 | python-version-file: 'pyproject.toml' |
| 28 | + |
26 | 29 | - name: Install dependencies |
27 | 30 | run: | |
28 | | - python -m pip install --upgrade pip |
29 | | - python -m pip install invoke |
30 | | - python -m pip install -e .[dev] |
| 31 | + python -m pip install --upgrade pip |
| 32 | + python -m pip install -e .[dev] |
31 | 33 | |
32 | 34 | - name: Upload SDGym Benchmark |
33 | 35 | env: |
34 | 36 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
35 | 37 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
36 | 38 | AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} |
37 | 39 | GITHUB_LOCAL_RESULTS_DIR: ${{ runner.temp }}/sdgym-leaderboard-files |
38 | | - |
39 | 40 | run: | |
40 | 41 | invoke upload-benchmark-results |
41 | | - - name: Create pull request for SDGym benchmark result |
42 | | - id: create_pr |
43 | | - if: env.SKIP_UPLOAD != 'true' |
44 | | - uses: peter-evans/create-pull-request@v4 |
45 | | - with: |
46 | | - token: ${{ secrets.GH_ACCESS_TOKEN }} |
47 | | - commit-message: "Upload SDGym Benchmark Results (${{ env.FOLDER_NAME }})" |
48 | | - author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" |
49 | | - committer: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" |
50 | | - title: "Upload SDGym Benchmark Results - ${{ env.FOLDER_NAME }}" |
51 | | - body: | |
52 | | - This is an **auto-generated PR** for uploading SDGym benchmark latest results. |
| 42 | + echo "GITHUB_LOCAL_RESULTS_DIR=$GITHUB_LOCAL_RESULTS_DIR" >> $GITHUB_ENV |
| 43 | +
|
| 44 | + - name: Check skip upload flag |
| 45 | + run: | |
| 46 | + if [ "${SKIP_UPLOAD}" = "true" ]; then |
| 47 | + echo "Upload skipped. Exiting workflow." |
| 48 | + exit 0 |
| 49 | + fi |
| 50 | + - name: Prepare summary file for PR |
| 51 | + run: | |
| 52 | + mkdir pr-staging |
| 53 | + echo "Looking for: $GITHUB_LOCAL_RESULTS_DIR/${FOLDER_NAME}_summary.csv" |
| 54 | + ls -l "$GITHUB_LOCAL_RESULTS_DIR" |
| 55 | + cp "$GITHUB_LOCAL_RESULTS_DIR/${FOLDER_NAME}_summary.csv" \ |
| 56 | + "pr-staging/SDGym_summary_${FOLDER_NAME}.csv" |
53 | 57 |
|
54 | | - branch: sdgym-benchmark-upload |
55 | | - branch-suffix: short-commit-hash |
56 | | - base: gatsby-home |
| 58 | + - name: Checkout target repo (sdv-dev.github.io) |
| 59 | + run: | |
| 60 | + git clone https://github.com/sdv-dev/sdv-dev.github.io.git target-repo |
| 61 | + cd target-repo |
| 62 | + git checkout gatsby-home |
| 63 | + - name: Copy summary and create PR |
| 64 | + env: |
| 65 | + FOLDER_NAME: ${{ env.FOLDER_NAME }} |
| 66 | + run: | |
| 67 | + cp pr-staging/SDGym_summary_${FOLDER_NAME}.csv target-repo/assets/ |
| 68 | +
|
| 69 | + cd target-repo |
| 70 | + git checkout -b sdgym-benchmark-upload-${FOLDER_NAME} |
| 71 | + git config --local user.name "${GITHUB_ACTOR}" |
| 72 | + git config --local user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" |
| 73 | +
|
| 74 | + git add assets/ |
| 75 | + git commit -m "Upload SDGym Benchmark Summary ($FOLDER_NAME)" |
| 76 | +
|
| 77 | + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/sdv-dev/sdv-dev.github.io.git |
| 78 | + git push origin sdgym-benchmark-upload-${FOLDER_NAME} |
| 79 | +
|
| 80 | + gh pr create \ |
| 81 | + --repo sdv-dev/sdv-dev.github.io \ |
| 82 | + --head sdgym-benchmark-upload-${FOLDER_NAME} \ |
| 83 | + --base gatsby-home \ |
| 84 | + --title "Upload SDGym Benchmark Summary ($FOLDER_NAME)" \ |
| 85 | + --body "Automated benchmark summary upload" \ |
| 86 | + --assignee "${{ github.actor }}" |
57 | 87 |
|
58 | 88 | - name: Send Slack notification |
59 | | - if: env.SKIP_UPLOAD != 'true' |
60 | 89 | env: |
61 | 90 | SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} |
62 | | - |
63 | 91 | run: | |
64 | 92 | invoke notify-sdgym-benchmark-uploaded \ |
65 | | - --folder-name ${{ env.FOLDER_NAME }} \ |
66 | | - --pr-url "${{ steps.create_pr.outputs.pull-request-url }}" |
67 | | -
|
| 93 | + --folder-name $FOLDER_NAME \ |
| 94 | + --pr-url "$(gh pr view --json url -q .url)" |
0 commit comments