From 1e0ffe5a870c2a092dbc35949b6d86808c1e2852 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:49:06 -0400 Subject: [PATCH 1/4] chore: rename `daily.yml` to `ci.yml` --- .github/workflows/{daily.yml => ci.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{daily.yml => ci.yml} (99%) diff --git a/.github/workflows/daily.yml b/.github/workflows/ci.yml similarity index 99% rename from .github/workflows/daily.yml rename to .github/workflows/ci.yml index 6e7f14e..62a5344 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Daily +name: CI on: # Run daily at midnight. From 21d6e6945a398d6743b14d52e53d14d80ef42b6e Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:55:07 -0400 Subject: [PATCH 2/4] feat: dry-run on pull requests --- .github/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62a5344..ebc05f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,11 @@ on: # Run daily at midnight. schedule: - cron: 0 0 * * * - # Run whenever this workflow is changed. + # Run whenever this workflow is changed on the main branch. push: branches: [main] + # Run whenever a PR is opened or updated, but do not upload results. + pull_request: # Allow running manually. workflow_dispatch: @@ -61,6 +63,8 @@ jobs: echo hash=$HASH >> $GITHUB_OUTPUT - name: Upload benchmarks + # Do not upload benchmarks for pull requests. + if: ${{ github.event_name != 'pull_request' }} env: BENCHER_PROJECT: bevy BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} @@ -118,6 +122,8 @@ jobs: echo hash=$HASH >> $GITHUB_OUTPUT - name: Upload benchmarks + # Do not upload benchmarks for pull requests. + if: ${{ github.event_name != 'pull_request' }} env: BENCHER_PROJECT: bevy BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} From 6c08cc02cde9daf1052052bc8b08c29411d3b5ba Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:07:32 -0400 Subject: [PATCH 3/4] feat: use `--dry-run` instead of skipping on pull requests --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebc05f6..927fe48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,8 @@ jobs: BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} BENCHER_TESTBED: github-actions run: | - bencher run \ + # Do not upload benchmarks for pull requests. + bencher run ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \ --adapter rust_criterion \ --hash ${{ steps.bevy-hash.outputs.hash }} \ --err \ @@ -122,14 +123,13 @@ jobs: echo hash=$HASH >> $GITHUB_OUTPUT - name: Upload benchmarks - # Do not upload benchmarks for pull requests. - if: ${{ github.event_name != 'pull_request' }} env: BENCHER_PROJECT: bevy BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }} BENCHER_TESTBED: github-actions run: | - bencher run \ + # Do not upload benchmarks for pull requests. + bencher run ${{ github.event_name == 'pull_request' && '--dry-run' || '' }} \ --adapter json \ --hash ${{ steps.bevy-hash.outputs.hash }} \ --err \ From a310dcf640d94f4d9ed28ab4ce2518609fb49d8f Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:13:54 -0400 Subject: [PATCH 4/4] fix: remove `if` --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 927fe48..a84a67d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,8 +63,6 @@ jobs: echo hash=$HASH >> $GITHUB_OUTPUT - name: Upload benchmarks - # Do not upload benchmarks for pull requests. - if: ${{ github.event_name != 'pull_request' }} env: BENCHER_PROJECT: bevy BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}