Skip to content

Commit 4bfe03d

Browse files
filipecosta90rafie
authored andcommitted
Updated benchmark trigger by label action:run-benchmark and to run performance nightly only once a week (RedisJSON#896)
(cherry picked from commit 70c0bf3)
1 parent dc6dea1 commit 4bfe03d

File tree

2 files changed

+65
-5
lines changed

2 files changed

+65
-5
lines changed

.circleci/config.yml

+31-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
version: 2.1
22

3+
parameters:
4+
run_default_flow:
5+
default: true
6+
type: boolean
7+
run_benchmark_flow_label:
8+
default: false
9+
type: boolean
10+
311
commands:
412
early-returns:
513
steps:
@@ -499,7 +507,6 @@ on-integ-branch: &on-integ-branch
499507
- master
500508
- /^\d+\.\d+.*$/
501509
- /^feature-.*$/
502-
- /^perf.*$/
503510
tags:
504511
ignore: /.*/
505512

@@ -510,7 +517,6 @@ on-integ-branch-cron: &on-integ-branch-cron
510517
- master
511518
- /^\d+\.\d+.*$/
512519
- /^feature-.*$/
513-
- /^perf.*$/
514520

515521
not-on-integ-branch: &not-on-integ-branch
516522
filters:
@@ -519,7 +525,6 @@ not-on-integ-branch: &not-on-integ-branch
519525
- master
520526
- /^\d+\.\d+.*$/
521527
- /^feature-.*$/
522-
- /^perf.*$/
523528
tags:
524529
ignore: /.*/
525530

@@ -537,7 +542,6 @@ on-integ-and-version-tags: &on-integ-and-version-tags
537542
- master
538543
- /^\d+\.\d+.*$/
539544
- /^feature-.*$/
540-
- /^perf.*$/
541545
tags:
542546
only: /^v[0-9].*/
543547

@@ -546,6 +550,8 @@ on-integ-and-version-tags: &on-integ-and-version-tags
546550
workflows:
547551
version: 2
548552
default-flow:
553+
when:
554+
<< pipeline.parameters.run_default_flow >>
549555
jobs:
550556
- build-linux-debian:
551557
name: build
@@ -602,7 +608,17 @@ workflows:
602608
<<: *on-integ-and-version-tags
603609
context: common
604610

605-
611+
benchmark_flow_label:
612+
when:
613+
<< pipeline.parameters.run_benchmark_flow_label >>
614+
jobs:
615+
- benchmark-json-oss-standalone:
616+
<<: *on-any-branch
617+
context: common
618+
- benchmark-json-oss-standalone-profiler:
619+
<<: *on-any-branch
620+
context: common
621+
606622
nightly:
607623
triggers:
608624
- schedule:
@@ -614,6 +630,16 @@ workflows:
614630
matrix:
615631
parameters:
616632
redis_version: ["6.0", "6.2", "7", "unstable"]
633+
634+
nightly-perf-once-a-week:
635+
triggers:
636+
- schedule:
637+
# “At 07:00 on Mondays.”
638+
cron: "00 07 * * 1"
639+
filters:
640+
branches:
641+
only: master
642+
jobs:
617643
- benchmark-json-oss-standalone:
618644
context: common
619645
- benchmark-json-oss-standalone-profiler:
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Check if needs trigger CircleCI benchmark
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled, synchronize]
6+
7+
jobs:
8+
haslabel:
9+
name: analyse labels
10+
runs-on: ubuntu-latest
11+
outputs:
12+
benchmark: ${{ steps.haslabel.outputs.labeled-run-benchmark }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Labeled with run-benchmark
16+
id: haslabel
17+
uses: DanielTamkin/HasLabel@v1.0.4
18+
with:
19+
contains: 'run-benchmark'
20+
perf-ci:
21+
name: Trigger CI benchmarks
22+
needs: haslabel
23+
if: needs.haslabel.outputs.benchmark
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: curl-circle-ci
28+
run: |
29+
curl --request POST \
30+
--url https://circleci.com/api/v2/project/gh/${{ github.repository }}/pipeline \
31+
--header 'Circle-Token: ${{ secrets.CIRCLE_CI_SECRET }}' \
32+
--header 'content-type: application/json' \
33+
--data '{"branch": "${{ github.event.pull_request.head.ref }}",
34+
"parameters": {"run_default_flow":false, "run_benchmark_flow_label":true}}'

0 commit comments

Comments
 (0)