Skip to content

Commit

Permalink
Add benchmarker, run on github actions (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn authored Oct 5, 2022
1 parent 851f30f commit b235312
Show file tree
Hide file tree
Showing 9 changed files with 3,224 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/benchmarker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Node.js CI

on: push

jobs:
benchmark:
# TODO should we use the same container as circle & central?
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.17.0]
services:
# see: https://docs.github.com/en/enterprise-server@3.5/actions/using-containerized-services/creating-postgresql-service-containers
postgres:
image: postgres:9.6
env:
POSTGRES_PASSWORD: odktest
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: node lib/bin/create-docker-databases.js
- name: Benchmark
timeout-minutes: 10
run: ./benchmarker/scripts/ci-benchmark
- name: Backend Logs
if: always()
run: "! [[ -f ./backend.log ]] || cat ./backend.log"
29 changes: 29 additions & 0 deletions benchmarker/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
env: {
commonjs: true,
es2021: true,
node: true,
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: "latest",
},
rules: {
'indent': 'off',
'key-spacing': 'off',
'keyword-spacing': 'off',
'no-console': 'off',
'no-mixed-operators': 'off',
'no-multi-spaces': 'off',
'no-plusplus': 'off',
'no-return-assign': 'off',
'no-shadow': 'off',
'no-undef-init': 'error',
'no-unused-expressions': 'error',
'no-use-before-define': [ 'error', { functions:false } ],
'semi': [ 'error', 'always' ],
'semi-style': 'off',
'space-in-parens': 'off',
'switch-colon-spacing': 'off',
},
};
2 changes: 2 additions & 0 deletions benchmarker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
/logs/
Loading

0 comments on commit b235312

Please sign in to comment.