Skip to content

Commit d491954

Browse files
committed
ci: run build and push images after benchmark
1 parent 033d83d commit d491954

File tree

2 files changed

+45
-57
lines changed

2 files changed

+45
-57
lines changed

.github/workflows/build_and_push_images.yml renamed to .github/workflows/bench_and_build.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,58 @@
1-
name: Build and push images
1+
name: Run benchmark and build images
22

33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- master
86

97
concurrency:
108
group: ${{ github.workflow }}-${{ github.sha }}
119
cancel-in-progress: true
1210

1311
jobs:
14-
build-and-push-base-and-bench-images:
12+
benchmark:
13+
name: Run benchmark
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
language:
20+
- "crystal"
21+
- "go"
22+
- "nodejs"
23+
- "php"
24+
- "python"
25+
- "ruby"
26+
env:
27+
ISHOCON_APP_LANG: ${{ matrix.language }}
28+
UNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Replace base image in docker-compose.yml with github actor name
32+
run: |
33+
make change-lang
34+
sed -i 's/ishocon2-app-base/${{ env.UNAME }}\/ishocon2-app-base/g' ./docker-compose.yml
35+
sed -i 's/ishocon2-bench/${{ env.UNAME }}\/ishocon2-bench/g' ./docker-compose.yml
36+
sed -i 's/ishocon2-app-${{ env.ISHOCON_APP_LANG }}/${{ env.UNAME }}\/ishocon2-app-${{ env.ISHOCON_APP_LANG }}/g' ./docker-compose.yml
37+
cat ./docker-compose.yml
38+
- name: Login to Docker Hub
39+
uses: docker/login-action@v3
40+
with:
41+
username: ${{ env.UNAME }}
42+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
43+
- name: Build images
44+
run: |
45+
make pull || true
46+
make build
47+
timeout-minutes: 20
48+
- run: make up bench-with-db-init
49+
timeout-minutes: 10
50+
- name: Dump docker logs
51+
uses: jwalton/gh-docker-logs@v2
52+
if: ${{ always() }}
53+
build-base-and-bench-images:
1554
name: Build and push base and bench images
55+
needs: benchmark
1656
runs-on: ubuntu-latest
1757
timeout-minutes: 60
1858
env:
@@ -69,7 +109,7 @@ jobs:
69109
name: Build app images
70110
runs-on: ubuntu-latest
71111
timeout-minutes: 60
72-
needs: build-and-push-base-and-bench-images
112+
needs: build-base-and-bench-images
73113
strategy:
74114
fail-fast: false
75115
matrix:

.github/workflows/benchmark.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)