forked from showwin/ISHOCON2
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.54 KB
/
benchmark.yml
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
name: Benchmark
on:
workflow_dispatch:
push:
jobs:
benchmark:
name: Run benchmark
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
language:
- "crystal"
- "go"
- "nodejs"
- "php"
- "python"
- "ruby"
env:
ISHOCON_APP_LANG: ${{ matrix.language }}
UNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
steps:
- uses: actions/checkout@v4
- name: Replace base image in docker-compose.yml with github actor name
run: |
make change-lang
sed -i 's/ishocon2-app-base/${{ env.UNAME }}\/ishocon2-app-base/g' ./docker-compose.yml
sed -i 's/ishocon2-bench/${{ env.UNAME }}\/ishocon2-bench/g' ./docker-compose.yml
sed -i 's/ishocon2-app-${{ env.ISHOCON_APP_LANG }}/${{ env.UNAME }}\/ishocon2-app-${{ env.ISHOCON_APP_LANG }}/g' ./docker-compose.yml
cat ./docker-compose.yml
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.UNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build images
run: |
make pull || true
make build
timeout-minutes: 20
- run: make up bench-with-db-init
timeout-minutes: 10
- name: Dump docker logs
uses: jwalton/gh-docker-logs@v2
if: ${{ always() }}
build:
name: Build and push images
needs: [benchmark]
uses: './.github/workflows/build_and_push_images.yml'
secrets: inherit