Skip to content

Commit cda9150

Browse files
committed
Refactor bench and tests directories.
1 parent 544e635 commit cda9150

31 files changed

+114
-43
lines changed

.github/workflows/docker-image.yml

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
1-
name: Docker Image CI
1+
name: Create and publish a Docker image
22

33
on:
44
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
5+
branches: ["release"]
86

9-
jobs:
10-
11-
build:
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
1210

11+
jobs:
12+
build-and-push-image:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
1417

1518
steps:
16-
- uses: actions/checkout@v2
17-
- name: Build the Docker image
18-
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Log in to the Container registry
23+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Extract metadata (tags, labels) for Docker
30+
id: meta
31+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
32+
with:
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
35+
- name: Build and push Docker image
36+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
37+
with:
38+
context: .
39+
push: true
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}

bench.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
benchmark-driver bench/benchmark/*.yml --rbenv '3.0.0' -e 'target/release/ruruby' --output markdown
2+
benchmark-driver bench/benchmark/*.rb --rbenv '3.0.0' -e 'target/release/ruruby' --output markdown

bench/bench.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def print_avesd(ave_sd)
144144

145145
def perf(app_name)
146146
puts "benchmark: #{app_name}"
147-
target_file = File.expand_path("../../tests/#{app_name}", __FILE__)
147+
target_file = File.expand_path("../../bench/benchmark/#{app_name}", __FILE__)
148148
command = "#{@time_command} ruby #{target_file} > /dev/null"
149149
real_ruby, user_ruby, sys_ruby, rss_ruby = get_results(command)
150150

@@ -206,14 +206,14 @@ def perf_optcarrot(option = "")
206206
@md3 += "| x #{'%.2f' % rss_mul} |\n"
207207
end
208208

209-
['simple_call.rb',
210-
'accessor_get.rb',
209+
['accessor_get.rb',
211210
'accessor_set.rb',
212211
'ivar_get.rb',
213212
'ivar_set.rb',
214213
'loop_times.rb',
215214
'loop_for.rb',
216215
'loop_whileloop.rb',
216+
'so_nested_loop.rb',
217217
'so_concatenate.rb',
218218
'string_scan_str.rb',
219219
'string_scan_re.rb',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)