Skip to content

Commit 86d100c

Browse files
authored
Merge pull request #986 from PlummersSoftwareLLC/drag-race
Update Maskwalk brranch from drag-race
2 parents 919595a + 606baba commit 86d100c

File tree

23 files changed

+1566
-1066
lines changed

23 files changed

+1566
-1066
lines changed

.github/workflows/CI.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ on:
66
pull_request:
77
branches: ["**"]
88
workflow_dispatch:
9-
branches: ["**"]
109

1110
jobs:
1211
collect-solutions:
13-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1413

1514
steps:
1615
- name: "Checkout code"
17-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1817

1918
- name: "Find Dockerfiles"
2019
id: "solutions"
@@ -31,10 +30,10 @@ jobs:
3130
solutions: ${{ steps.solutions.outputs.solutions }}
3231

3332
build:
34-
env:
33+
env:
3534
ENABLE_DOCKER_PUSH: ${{ github.repository_owner == 'PlummersSoftwareLLC' && github.ref == 'refs/heads/drag-race' }}
3635

37-
runs-on: "ubuntu-20.04"
36+
runs-on: "ubuntu-22.04"
3837

3938
needs: ["collect-solutions"]
4039

@@ -45,7 +44,7 @@ jobs:
4544

4645
steps:
4746
- name: "Checkout code"
48-
uses: actions/checkout@v3
47+
uses: actions/checkout@v4
4948

5049
- name: "Normalize solution name"
5150
id: solution-name
@@ -76,32 +75,32 @@ jobs:
7675
config_file: ./config/hadolint.yml
7776

7877
- name: Set up QEMU
79-
uses: docker/setup-qemu-action@v2
78+
uses: docker/setup-qemu-action@v3
8079

8180
- name: Setup Docker Buildx
82-
uses: docker/setup-buildx-action@v2
81+
uses: docker/setup-buildx-action@v3
8382

8483
- name: Login to DockerHub
8584
if: ${{ env.ENABLE_DOCKER_PUSH == 'true' }}
86-
uses: docker/login-action@v2
85+
uses: docker/login-action@v3
8786
with:
8887
username: ${{ secrets.DOCKER_USERNAME }}
8988
password: ${{ secrets.DOCKER_PASSWORD }}
9089

9190
- name: Build amd64
9291
if: steps.arch-amd64.outputs.build
93-
uses: docker/build-push-action@v3
92+
uses: docker/build-push-action@v6
9493
with:
9594
tags: primeimages/primes:${{ steps.solution-name.outputs.normalized }}
9695
context: ${{ matrix.solution }}
9796
platforms: linux/amd64
9897
push: ${{ env.ENABLE_DOCKER_PUSH }}
9998
cache-from: type=registry,ref=primeimages/primes:${{ steps.solution-name.outputs.normalized }}
10099
cache-to: type=inline
101-
100+
102101
- name: Build arm64
103102
if: steps.arch-arm64.outputs.build
104-
uses: docker/build-push-action@v3
103+
uses: docker/build-push-action@v6
105104
with:
106105
tags: primeimages/primes:${{ steps.solution-name.outputs.normalized }}
107106
context: ${{ matrix.solution }}

BENCHMARK.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Some solutions are not included in the automated benchmark runs, either because
2222
- [Running a benchmark of all solutions for a particular language](#running-a-benchmark-of-all-solutions-for-a-particular-language)
2323
- [Running in unconfined mode](#running-in-unconfined-mode)
2424
- [Output formats](#output-formats)
25+
- [Setting the solution timeout](#setting-the-solution-timeout)
2526

2627
## What operating system to use?
2728

@@ -375,3 +376,13 @@ The output format can be controlled via the `FORMATTER` variable like this:
375376
make FORMATTER=json
376377
make DIRECTORY=PrimeCrystal/solution_1 FORMATTER=csv
377378
```
379+
380+
## Setting the solution timeout
381+
382+
The run of each solution is limited to a certain duration, which is 10 minutes by default.
383+
You can change this setting through the `TIMEOUT` variable like this:
384+
385+
```shell
386+
make TIMEOUT=15
387+
make DIRECTORY=PrimeCPP/solution_2 TIMEOUT=15
388+
```

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SHELL := /bin/bash
44

55
DIRECTORY := $(shell pwd)
66
FORMATTER := "table"
7+
TIMEOUT := "10"
78

89
.PHONY: all
910
all: benchmark
@@ -14,6 +15,7 @@ benchmark: check-env
1415
ARGS=("-d $${REALPATH}" "-f $(FORMATTER)"); \
1516
[ ! -z $${OUTPUT_FILE} ] && ARGS+=( "-o $${OUTPUT_FILE}" ); \
1617
[ ! -z $${UNCONFINED} ] && ARGS+=( "--unconfined" ); \
18+
[ ! -z $${TIMEOUT} ] && ARGS+=( "-t $${TIMEOUT}" ); \
1719
cd ./tools; npm ci --silent && npm start --silent -- benchmark $${ARGS[@]}
1820

1921
.PHONY: check-env

PrimeBrainFuck/solution_1/Dockerfile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
# container for building
2-
FROM ubuntu:18.04 AS build
2+
FROM ubuntu:22.04 AS build
33

44
# install tools
55
RUN apt-get update \
6-
&& apt-get install -y lsb-release wget software-properties-common git
7-
8-
# install clang-12 for C++ standard 17
9-
RUN wget https://apt.llvm.org/llvm.sh \
10-
&& chmod +x llvm.sh \
11-
&& ./llvm.sh 12
6+
&& apt-get install -y lsb-release wget software-properties-common git clang cmake
127

138
# set clang as default compiler for C and C++
14-
ENV CC=/usr/bin/clang-12 \
15-
CXX=/usr/bin/clang++-12
16-
17-
# install latest version of cmake
18-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
19-
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \
20-
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' \
21-
&& apt-get update \
22-
&& apt-get install -y cmake
9+
ENV CC=/usr/bin/clang \
10+
CXX=/usr/bin/clang++
2311

2412
# clone custom language interpreter
2513
RUN git clone https://github.com/ThatAquarel/BrainF-ck-Interpreter \
@@ -34,10 +22,10 @@ RUN cmake -DCMAKE_BUILD_TYPE=Release .. \
3422
# build prime sieve caller
3523
WORKDIR /opt/app/
3624
COPY *.cpp *.b ./
37-
RUN clang++-12 -Ofast -std=c++17 PrimeBrainFuck.cpp -oPrimeBrainFuck
25+
RUN clang++ -Ofast -std=c++17 PrimeBrainFuck.cpp -oPrimeBrainFuck
3826

3927
# container for running built binaries
40-
FROM ubuntu:18.04
28+
FROM ubuntu:22.04
4129

4230
# copy binaries from build container to current
4331
COPY --from=build /BrainF-ck-Interpreter/release/brainfuck /usr/local/bin

0 commit comments

Comments
 (0)