-
-
Notifications
You must be signed in to change notification settings - Fork 780
130 lines (121 loc) · 4.38 KB
/
microbenchmarks.yaml
File metadata and controls
130 lines (121 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Workflow which runs micro benchmarks on nightly basis
# We run it nightly instead on every PR / merge to master since some of those benchmarks take quite a while.
name: Micro Benchmarks
on:
schedule:
- cron: '30 3 * * *'
pull_request:
types: [opened, reopened, synchronize]
branches:
# Only for PRs targeting those branches
- master
- v[0-9]+.[0-9]+
paths:
# Only for PRs that touch the benchmarks
- .github/workflows/microbenchmarks.yaml
- st2common/benchmarks/**
jobs:
# Special job which automatically cancels old runs for the same branch, prevents runs for the
# same file set which has already passed, etc.
pre_job:
name: Skip Duplicate Jobs Pre Job
runs-on: ubuntu-22.04
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@4c656bbdb6906310fa6213604828008bc28fe55d # v3.3.0
with:
cancel_others: 'true'
github_token: ${{ github.token }}
micro-benchmarks:
needs: pre_job
# NOTE: We always want to run job on master since we run some additional checks there (code
# coverage, etc)
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/master' }}
name: '${{ matrix.make.name }} - Python ${{ matrix.python.version-short }}'
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# NOTE: We need to use full Python version as part of Python deps cache key otherwise
# setup virtualenv step will fail.
python:
- {version-short: '3.9', version: '3.9.25'}
- {version-short: '3.10', version: '3.10.16'}
- {version-short: '3.11', version: '3.11.11'}
- {version-short: '3.12', version: '3.12.12'}
- {version-short: '3.13', version: '3.13.5'}
make:
- name: 'Microbenchmarks'
task: 'micro-benchmarks'
shard: {k: 0, n: 1}
services:
mongo:
image: mongo:8.2
ports:
- 27017:27017
rabbitmq:
image: rabbitmq:4.2-management
options: >-
--name rabbitmq
ports:
- 5671:5671/tcp # AMQP SSL port
- 5672:5672/tcp # AMQP standard port
- 15672:15672/tcp # Management: HTTP, CLI
env:
TASK: '${{ matrix.make.task }}'
NODE_TOTAL: '${{ matrix.make.shard.n }}'
NODE_INDEX: '${{ matrix.make.shard.k }}'
COLUMNS: '120'
ST2_CI: 'true'
# GitHub is juggling how to set vars for multiple shells. Protect our PATH assumptions.
PATH: /home/runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: 'Set up Python (${{ matrix.python.version }}) and Cache Deps'
uses: ./.github/actions/setup-python
with:
python-version: '${{ matrix.python.version }}'
- name: Cache and Install APT Dependencies
uses: ./.github/actions/apt-packages
- name: Install virtualenv
run: |
./scripts/github/install-virtualenv.sh
- name: Install requirements
run: |
./scripts/ci/install-requirements.sh
- name: Print versions
run: |
./scripts/ci/print-versions.sh
- name: Run Micro Benchmarks
timeout-minutes: 30
# use: script -e -c to print colors
run: |
script -e -c "make ${TASK}" && exit 0
- name: Upload Histograms
uses: actions/upload-artifact@v4
with:
name: benchmark_histograms-py${{ matrix.python.version }}
path: benchmark_histograms/
retention-days: 30
slack-notification:
name: Slack notification for failed builds
if: always()
needs:
- micro-benchmarks
runs-on: ubuntu-22.04
steps:
- name: Workflow conclusion
# this step creates an environment variable WORKFLOW_CONCLUSION and is the most reliable way to check the status of previous jobs
uses: technote-space/workflow-conclusion-action@v2
- name: CI Run Failure Slack Notification
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: development
status: FAILED
color: danger