Skip to content

Commit

Permalink
fix: improve flaky CI runs
Browse files Browse the repository at this point in the history
* move saving of previous benchmarks results further in the workflow files so that there is a smaller window when other action might push new changes
  • Loading branch information
ktrz committed Jan 25, 2024
1 parent 65ff1d7 commit 79ceada
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 103 deletions.
143 changes: 77 additions & 66 deletions .github/workflows/ci-results-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
node-version: 20
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
- run: rustup toolchain update nightly && rustup default nightly
- name: Run benchmark
run: cd examples/rust && cargo +nightly bench | tee output.txt

- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Store benchmark result
uses: ./
with:
Expand All @@ -46,11 +48,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
node-version: 20
Expand All @@ -60,11 +57,18 @@ jobs:
go-version: "stable"
- run: npm ci
- run: npm run build
- name: Run benchmark
run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt

- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Run benchmark
run: cd examples/go && go test -bench 'BenchmarkFib' | tee output.txt
- name: Store benchmark result
uses: ./
with:
Expand All @@ -81,22 +85,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Run benchmark
run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt

- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Run benchmark
run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt
- name: Store benchmark result
uses: ./
with:
Expand All @@ -113,11 +119,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
node-version: 20
Expand All @@ -127,14 +128,21 @@ jobs:
python-version: 3.9
- 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: Run benchmark
run: |
cd examples/pytest
pip install -r requirements.txt
pytest bench.py --benchmark-json output.json
- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Store benchmark result
uses: ./
with:
Expand All @@ -151,20 +159,12 @@ jobs:
runs-on: ubuntu-20.04
steps:
- 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@v4
with:
node-version: 20
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@v4
with:
Expand All @@ -174,6 +174,16 @@ jobs:
run: |
cd examples/cpp
make json
- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Store benchmark result
uses: ./
with:
Expand All @@ -190,27 +200,29 @@ jobs:
runs-on: ubuntu-20.04
steps:
- 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@v4
with:
node-version: 20
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: Run benchmark
run: |
cd examples/catch2
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
./Catch2_bench > ../benchmark_result.txt
- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Store benchmark result
uses: ./
with:
Expand All @@ -227,20 +239,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
node-version: 20
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
- uses: julia-actions/setup-julia@v1
with:
version: '1'
Expand All @@ -252,6 +256,16 @@ jobs:
using Pkg;
Pkg.instantiate();
include("fib.jl")'
- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Store benchmark result
uses: ./
with:
Expand All @@ -268,11 +282,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v3
with:
dotnet-version: '6.0.101' # SDK Version to use. keep in line with examples/benchmarkdotnet/global.json
Expand All @@ -282,11 +291,18 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Run benchmark
run: cd examples/benchmarkdotnet && dotnet run --exporters json --filter '*'

- uses: actions/checkout@v4
with:
repository: benchmark-action/github-action-benchmark-results
ref: 'gh-pages'
path: 'dist/other-repo'
- name: Save previous data.js
run: |
cp ./dist/other-repo/dev/bench/data.js before_data.js
- name: Run benchmark
run: cd examples/benchmarkdotnet && dotnet run --exporters json --filter '*'
- name: Store benchmark result
uses: ./
with:
Expand All @@ -303,11 +319,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- 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@v4
with:
node-version: 20
Expand Down
Loading

0 comments on commit 79ceada

Please sign in to comment.