From 036be2a998715b878d1dae2f88bd8ce86ca79ab7 Mon Sep 17 00:00:00 2001 From: Maria Ines Parnisari Date: Wed, 24 Jan 2024 12:32:24 -0300 Subject: [PATCH 1/3] update to node 20 (#208) --- .github/workflows/ci-results-repo.yml | 16 ++++++++-------- .github/workflows/ci.yml | 22 +++++++++++----------- .nvmrc | 2 +- action.yml | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-results-repo.yml b/.github/workflows/ci-results-repo.yml index 34a88fd79..230ba0d1d 100644 --- a/.github/workflows/ci-results-repo.yml +++ b/.github/workflows/ci-results-repo.yml @@ -20,7 +20,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -56,7 +56,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/setup-go@v4 with: go-version: "stable" @@ -94,7 +94,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -129,7 +129,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/setup-python@v2 with: python-version: 3.9 @@ -170,7 +170,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -212,7 +212,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -252,7 +252,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -331,7 +331,7 @@ jobs: path: 'dist/other-repo' - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bdebb0728..ad2fe3218 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/setup-go@v4 with: go-version: "stable" @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -115,7 +115,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/setup-python@v2 with: python-version: 3.9 @@ -153,7 +153,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -192,7 +192,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -229,7 +229,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -302,7 +302,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/setup-java@v2 with: distribution: 'adopt' @@ -341,7 +341,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -377,7 +377,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm @@ -397,7 +397,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 - uses: actions/cache@v1 with: path: ~/.npm diff --git a/.nvmrc b/.nvmrc index b6a7d89c6..2edeafb09 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16 +20 \ No newline at end of file diff --git a/action.yml b/action.yml index 1102952e5..daa6cd343 100644 --- a/action.yml +++ b/action.yml @@ -81,5 +81,5 @@ inputs: required: false runs: - using: 'node16' + using: 'node20' main: 'dist/src/index.js' From 83426c04e20ff3faef1257b544e08620a88c4551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Trze=C5=9Bniewski?= Date: Wed, 24 Jan 2024 16:49:01 +0100 Subject: [PATCH 2/3] chore: update actions/* (#212) * update actions/checkout to v4 * update actions/cache to v4 * update actions/setup-node to v4 * remove unnecessary usages of action/cache for node * update actions/setup-python to v5 * update actions/setup-dotnet to v3 * update actions/setup-java to v4 --- .github/workflows/benchmarkdotnet.yml | 4 +- .github/workflows/benchmarkjs.yml | 7 +- .github/workflows/catch2.yml | 2 +- .github/workflows/ci-results-repo.yml | 106 +++++++++-------------- .github/workflows/ci.yml | 119 ++++++++++---------------- .github/workflows/commit-comment.yml | 4 +- .github/workflows/cpp.yml | 4 +- .github/workflows/criterion-rs.yml | 2 +- .github/workflows/go.yml | 2 +- .github/workflows/java.yml | 4 +- .github/workflows/julia.yml | 4 +- .github/workflows/minimal.yml | 4 +- .github/workflows/pytest.yml | 4 +- .github/workflows/rust.yml | 2 +- README.md | 6 +- 15 files changed, 110 insertions(+), 164 deletions(-) diff --git a/.github/workflows/benchmarkdotnet.yml b/.github/workflows/benchmarkdotnet.yml index 049faeb4e..a9f59f190 100644 --- a/.github/workflows/benchmarkdotnet.yml +++ b/.github/workflows/benchmarkdotnet.yml @@ -13,8 +13,8 @@ jobs: name: Run Benchmark.Net benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-dotnet@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v3 with: dotnet-version: '6.0.101' # SDK Version to use. keep in line with examples/benchmarkdotnet/global.json - name: Run benchmark diff --git a/.github/workflows/benchmarkjs.yml b/.github/workflows/benchmarkjs.yml index 620625456..7c404ef58 100644 --- a/.github/workflows/benchmarkjs.yml +++ b/.github/workflows/benchmarkjs.yml @@ -13,8 +13,11 @@ jobs: name: Run JavaScript benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' - name: Run benchmark run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt diff --git a/.github/workflows/catch2.yml b/.github/workflows/catch2.yml index aa6d7a079..4c108fbca 100644 --- a/.github/workflows/catch2.yml +++ b/.github/workflows/catch2.yml @@ -13,7 +13,7 @@ jobs: name: Run C++ benchmark example runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build and run benchmarks with Catch2 run: | cd examples/catch2 diff --git a/.github/workflows/ci-results-repo.yml b/.github/workflows/ci-results-repo.yml index 230ba0d1d..8479199b2 100644 --- a/.github/workflows/ci-results-repo.yml +++ b/.github/workflows/ci-results-repo.yml @@ -12,19 +12,16 @@ jobs: name: Run Rust benchmark example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -48,22 +45,19 @@ jobs: name: Run Go benchmark example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - uses: actions/setup-go@v4 with: go-version: "stable" - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - run: npm ci - run: npm run build - name: Save previous data.js @@ -86,19 +80,16 @@ jobs: name: Run JavaScript benchmark example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -121,22 +112,19 @@ jobs: name: Run Pytest benchmark example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/setup-python@v2 + cache: 'npm' + - uses: actions/setup-python@v5 with: python-version: 3.9 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - run: npm ci - run: npm run build - name: Save previous data.js @@ -162,26 +150,23 @@ jobs: name: Run Google C++ Benchmark Framework example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js run: | cp ./dist/other-repo/dev/bench/data.js before_data.js - name: Cache Benchmark library - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: examples/cpp/benchmark key: ${{ runner.os }}-googlebenchmark-v1.5.0 @@ -204,19 +189,16 @@ jobs: name: Run Catch2 C++ Benchmark Framework example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -244,19 +226,16 @@ jobs: name: Run Julia benchmark example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -288,19 +267,19 @@ jobs: name: Run Benchmark.Net .Net Benchmark Framework example - github.com/benchmark-action/github-action-benchmark-results runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-dotnet@v1 + - uses: actions/setup-dotnet@v3 with: dotnet-version: '6.0.101' # SDK Version to use. keep in line with examples/benchmarkdotnet/global.json - - uses: actions/cache@v1 + - uses: actions/setup-node@v4 with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + node-version: 20 + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -323,19 +302,16 @@ jobs: name: Run alert check with actions/cache runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: benchmark-action/github-action-benchmark-results ref: 'gh-pages' path: 'dist/other-repo' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - uses: actions/setup-go@v4 @@ -344,7 +320,7 @@ jobs: - name: Run benchmark run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt - name: Download previous benchmark data - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ./cache key: ${{ runner.os }}-ci-cache-test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad2fe3218..597cc8e24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,14 +12,11 @@ jobs: name: Run Rust benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -45,17 +42,14 @@ jobs: name: Run Go benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 + cache: 'npm' - uses: actions/setup-go@v4 with: go-version: "stable" - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - run: npm ci - run: npm run build - name: Save previous data.js @@ -80,14 +74,11 @@ jobs: name: Run JavaScript benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -112,17 +103,14 @@ jobs: name: Run Pytest benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/setup-python@v2 + cache: 'npm' + - uses: actions/setup-python@v5 with: python-version: 3.9 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - run: npm ci - run: npm run build - name: Save previous data.js @@ -150,14 +138,11 @@ jobs: name: Run Google C++ Benchmark Framework example runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -167,7 +152,7 @@ jobs: cp ./dev/bench/data.js before_data.js git checkout - - name: Cache Benchmark library - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: examples/cpp/benchmark key: ${{ runner.os }}-googlebenchmark-v1.5.0 @@ -189,14 +174,11 @@ jobs: name: Run Catch2 C++ Benchmark Framework example runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -226,14 +208,11 @@ jobs: name: Run Julia benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - name: Save previous data.js @@ -267,14 +246,14 @@ jobs: name: Run Benchmark.Net .Net Benchmark Framework example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-dotnet@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - dotnet-version: '6.0.101' # SDK Version to use. keep in line with examples/benchmarkdotnet/global.json - - uses: actions/cache@v1 + node-version: 20 + cache: 'npm' + - uses: actions/setup-dotnet@v3 with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + dotnet-version: '6.0.101' # SDK Version to use. keep in line with examples/benchmarkdotnet/global.json - run: npm ci - run: npm run build - name: Save previous data.js @@ -299,18 +278,15 @@ jobs: name: Run JMH Java Benchmark Framework example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/setup-java@v2 + cache: 'npm' + - uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: '11' - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - run: npm ci - run: npm run build - name: Save previous data.js @@ -338,14 +314,11 @@ jobs: name: Run alert check with actions/cache runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run build - uses: actions/setup-go@v4 @@ -354,7 +327,7 @@ jobs: - name: Run benchmark run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt - name: Download previous benchmark data - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ./cache key: ${{ runner.os }}-ci-cache-test @@ -374,14 +347,11 @@ jobs: name: Run unit tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run coverage - name: Apply yamllint @@ -394,14 +364,11 @@ jobs: name: Run linting and formatting check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 20 - - uses: actions/cache@v1 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + cache: 'npm' - run: npm ci - run: npm run lint - run: npm run format:check diff --git a/.github/workflows/commit-comment.yml b/.github/workflows/commit-comment.yml index be84cb948..7f3043343 100644 --- a/.github/workflows/commit-comment.yml +++ b/.github/workflows/commit-comment.yml @@ -13,14 +13,14 @@ jobs: name: Run alert check without using Git branch runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "stable" - name: Run benchmark run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt - name: Download previous benchmark data - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ./cache key: ${{ runner.os }}-benchmark diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index dd6abe188..010ebb6f5 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -13,9 +13,9 @@ jobs: name: Run C++ benchmark example runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache Benchmark library - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: examples/cpp/benchmark key: ${{ runner.os }}-googlebenchmark-v1.5.0 diff --git a/.github/workflows/criterion-rs.yml b/.github/workflows/criterion-rs.yml index 663729773..98231cc5e 100644 --- a/.github/workflows/criterion-rs.yml +++ b/.github/workflows/criterion-rs.yml @@ -13,7 +13,7 @@ jobs: name: Run Criterion.rs benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: rustup toolchain update nightly && rustup default nightly - name: Run benchmark run: cd examples/criterion-rs && cargo +nightly bench -- --output-format bencher | tee output.txt diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 9c97db164..4657de9c5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,7 +13,7 @@ jobs: name: Run Go benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "stable" diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 2094678ea..03c706e46 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -13,8 +13,8 @@ jobs: name: Run JMH benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: 'adopt' java-version: '11' diff --git a/.github/workflows/julia.yml b/.github/workflows/julia.yml index a28bafd6e..7676a6aa9 100644 --- a/.github/workflows/julia.yml +++ b/.github/workflows/julia.yml @@ -22,12 +22,12 @@ jobs: arch: - x64 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 + - uses: actions/cache@v4 env: cache-name: cache-artifacts with: diff --git a/.github/workflows/minimal.yml b/.github/workflows/minimal.yml index d92abaa9f..a8edaba36 100644 --- a/.github/workflows/minimal.yml +++ b/.github/workflows/minimal.yml @@ -13,14 +13,14 @@ jobs: name: Run minimal steps to run github-action-benchmark runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "stable" - name: Run benchmark run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt - name: Download previous benchmark data - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ./cache key: ${{ runner.os }}-benchmark diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index fc8fd1a2d..d8888542f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -13,8 +13,8 @@ jobs: name: Run pytest-benchmark benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: 3.9 - name: Run benchmark diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e9e32290a..61aa225e1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,7 +13,7 @@ jobs: name: Run Rust benchmark example runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - run: rustup toolchain update nightly && rustup default nightly - name: Run benchmark run: cd examples/rust && cargo +nightly bench | tee output.txt diff --git a/README.md b/README.md index 836236682..47e0d20f7 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ jobs: name: Performance regression check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "stable" @@ -159,7 +159,7 @@ jobs: run: go test -bench 'BenchmarkFib' | tee output.txt # Download previous benchmark result from cache (if exists) - name: Download previous benchmark data - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ./cache key: ${{ runner.os }}-benchmark @@ -286,7 +286,7 @@ jobs: name: Performance regression check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: go-version: "stable" From 029e9b87f033929420da337eca96176c8d18969e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chris=20Trze=C5=9Bniewski?= Date: Thu, 25 Jan 2024 08:33:33 +0100 Subject: [PATCH 3/3] fix: 213 summary-always and gh-repository don't work together (#214) * move summary logic into writeBenchmark function so that we only clone repo once --- src/index.ts | 6 +----- src/write.ts | 18 ++++++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index c29d2a260..2d2215357 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import * as core from '@actions/core'; import { configFromJobInput } from './config'; import { extractResult } from './extract'; -import { writeBenchmark, writeSummary } from './write'; +import { writeBenchmark } from './write'; async function main() { const config = await configFromJobInput(); @@ -12,10 +12,6 @@ async function main() { await writeBenchmark(bench, config); - if (config.summaryAlways) { - await writeSummary(bench, config); - } - console.log('github-action-benchmark was run successfully!', '\nData:', bench); } diff --git a/src/write.ts b/src/write.ts index 945117696..19e75d5c8 100644 --- a/src/write.ts +++ b/src/write.ts @@ -536,17 +536,15 @@ export async function writeBenchmark(bench: Benchmark, config: Config) { } else { await handleComment(name, bench, prevBench, config); await handleAlert(name, bench, prevBench, config); + await handleSummary(name, bench, prevBench, config); } } -export async function writeSummary(bench: Benchmark, config: Config): Promise { - const { name, externalDataJsonPath } = config; - const prevBench = externalDataJsonPath - ? await writeBenchmarkToExternalJson(bench, externalDataJsonPath, config) - : await writeBenchmarkToGitHubPages(bench, config); +async function handleSummary(benchName: string, currBench: Benchmark, prevBench: Benchmark, config: Config) { + const { summaryAlways } = config; - if (prevBench === null) { - core.debug('Alert check was skipped because previous benchmark result was not found'); + if (!summaryAlways) { + core.debug('Summary was skipped because summary-always is disabled'); return; } @@ -556,7 +554,7 @@ export async function writeSummary(bench: Benchmark, config: Config): Promise { + const rows: SummaryTableRow[] = currBench.benches.map((bench) => { const previousBench = prevBench.benches.find((pb) => pb.name === bench.name); if (previousBench) { @@ -609,7 +607,7 @@ export async function writeSummary(bench: Benchmark, config: Config): Promise