From b9e7d6ee5f31b04b15e582becda36927daa0a666 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Thu, 24 Oct 2024 19:33:09 -0700 Subject: [PATCH 1/3] Avoid github actions spam. --- .github/workflows/build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e321916ca..2743a8b01 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -39,7 +39,7 @@ jobs: uses: actions/cache@v4 with: path: | - .scons_cache + .scons_cache emsdk osxcross jdk @@ -88,7 +88,6 @@ jobs: --ci-id ${{ runner.os }}-scons-${{ matrix.platform }}-${{ matrix.target }} \ --err \ --token '${{ secrets.BENCHER_API_TOKEN }}' \ - --github-actions '${{ secrets.GITHUB_TOKEN }}' \ --file results.json \ "hyperfine --show-output --runs 1 --export-json results.json 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }}'" - name: Upload Artifacts From a04583352226e96bc6e1aca8703f6f6b707c1593 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Thu, 24 Oct 2024 19:38:45 -0700 Subject: [PATCH 2/3] Post github actions only on alert. --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e321916ca..73104df2c 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -89,6 +89,7 @@ jobs: --err \ --token '${{ secrets.BENCHER_API_TOKEN }}' \ --github-actions '${{ secrets.GITHUB_TOKEN }}' \ + --ci-only-on-alert \ --file results.json \ "hyperfine --show-output --runs 1 --export-json results.json 'just $PLATFORM_ARGS && just build-platform-target ${{ matrix.platform }} ${{ matrix.target }}'" - name: Upload Artifacts From d046faeef7f1fa0fa550aede45bc545aa0294f9b Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Thu, 24 Oct 2024 19:59:01 -0700 Subject: [PATCH 3/3] Cache more often. --- .github/workflows/build.yaml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index adf1110c6..a8666de64 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + actions: write container: image: fedora:39 env: @@ -37,20 +38,22 @@ jobs: - name: Cache SCons cache uses: actions/cache@v4 + if: always() with: - path: | - .scons_cache - emsdk - osxcross - jdk - android_sdk - vulkan_sdk - mingw - key: ${{ runner.os }}-scons-${{ matrix.platform }}-${{ matrix.target }} + path: | + .scons_cache + emsdk + osxcross + jdk + android_sdk + vulkan_sdk + mingw + key: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}-${{ matrix.platform }}-${{ matrix.target }} restore-keys: | - ${{ runner.os }}-scons-${{ matrix.platform }}-${{ matrix.target }} - ${{ runner.os }}-scons- - ${{ runner.os }} + ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}-${{ matrix.platform }}-${{ matrix.target }} + ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}-${{ matrix.platform }} + ${{ matrix.platform }}-${{ matrix.target }} + ${{ matrix.platform }} - uses: bencherdev/bencher@main @@ -78,7 +81,7 @@ jobs: bencher run \ --project 'v-sekai-world' \ --adapter shell_hyperfine \ - --branch '${{ github.head_ref }}' \ + --branch '${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}' \ --testbed ubuntu-latest \ --threshold-measure latency \ --threshold-test t_test \