Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
acheronfail committed Jan 10, 2024
1 parent fae11ff commit fae1f86
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 43 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,15 @@ jobs:
# - tcl
# - zig
steps:
- run: sudo -E apt-get install -y git
- run: pwd
- run: ls -la
- run: |
cd;
git clone ${{ github.repositoryUrl }} count
cd count
just
- name: Checkout
uses: actions/checkout@v3
# do the thing
# - run: just test ${{ matrix.build }}
# - run: just measure ${{ matrix.build }}
# # report
# - uses: actions/upload-artifact@v3
# with:
# path: "${{ matrix.build }}.json"
- run: just test ${{ matrix.build }}
- run: just measure ${{ matrix.build }}
# report
- uses: actions/upload-artifact@v3
with:
path: "${{ matrix.build }}.json"

report:
needs: ["run"]
Expand All @@ -82,8 +76,7 @@ jobs:
- name: Generate Summary
run: |
cd scripts
npm install
node ./summary.js --results ../artifact > summary.txt
npm start --results ../artifact > summary.txt
cat summary.txt
- uses: actions/upload-artifact@v3
with:
Expand Down
38 changes: 16 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,40 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"

RUN apt-get update && apt-get install -y \
build-essential clang coffeescript curl default-jdk default-jre erlang \
fp-compiler gdb lldb gforth gfortran gnu-smalltalk gnucobol3 golang \
fp-compiler gdb lldb gforth gfortran git gnu-smalltalk gnucobol3 golang \
haskell-platform jq kotlin lua5.4 mono-complete moreutils nasm php ruby \
scala sudo swi-prolog tar tcl unzip wget xz-utils \
scala swi-prolog tar tcl unzip wget xz-utils \
&& apt-get clean
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
RUN curl -fSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs

RUN useradd -m runner && echo "runner ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/runner
USER runner
RUN curl -fSL https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:$PATH"

RUN curl -fsSL https://sh.rustup.rs | sh -s -- -y
ENV PATH="/home/runner/.cargo/bin:$PATH"

RUN curl -fsSL \
RUN curl -fSL \
https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh \
| bash
RUN cargo install ripgrep --features pcre2
RUN cargo binstall --no-confirm hyperfine just timers juliaup

RUN juliaup add release

RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/home/runner/.bun/bin:$PATH"
RUN curl -fSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"

RUN curl -fsSL https://deno.land/x/install/install.sh | sh
ENV PATH="/home/runner/.deno/bin:$PATH"
RUN curl -fSL https://deno.land/x/install/install.sh | sh
ENV PATH="/root/.deno/bin:$PATH"

RUN curl -fsSL https://crystal-lang.org/install.sh | sudo -E bash
RUN curl -fSL https://crystal-lang.org/install.sh | bash

RUN curl -fsSL https://nim-lang.org/choosenim/init.sh | sh -s -- -y
ENV PATH="/home/runner/.nimble/bin:$PATH"
RUN curl -fSL https://nim-lang.org/choosenim/init.sh | sh -s -- -y
ENV PATH="/root/.nimble/bin:$PATH"

RUN cd && curl -fSL "$(curl -fSL https://ziglang.org/download/index.json | jq -r '.[keys_unsorted[1]]["x86_64-linux"].tarball')" \
> zig.tar.xz \
&& mkdir -p "/home/runner/.zig" \
&& tar -xvf zig.tar.xz --strip-components=1 -C "/home/runner/.zig" \
&& mkdir -p "/root/.zig" \
&& tar -xvf zig.tar.xz --strip-components=1 -C "/root/.zig" \
&& rm zig.tar.xz
ENV PATH="/home/runner/.zig:$PATH"
ENV PATH="/root/.zig:$PATH"

WORKDIR /var/count
COPY --chown=runner:runner justfile justfile
COPY --chown=runner:runner scripts scripts
RUN cd scripts && npm install
10 changes: 5 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ _default:
setup: (_check "npm")
cd scripts && npm install

docker-sh: docker-build
docker run --rm -ti --platform 'linux/amd64' -v "$PWD/results:{{mount}}/results" {{tag}}
docker-sh:
docker run --rm -ti --platform 'linux/amd64' -v "$PWD:{{mount}}" {{tag}}

# NOTE: there are issues if you try to build this on an arm macbook via rosetta emulation
# - mono fails to install (https://github.com/mono/mono/issues/21423)
Expand All @@ -27,10 +27,10 @@ docker-push: docker-build
docker push {{tag}}

docker-measure what:
docker run --rm -ti --platform 'linux/amd64' -v "$PWD/results:{{mount}}/results" {{tag}} just measure {{what}}
docker run --rm -ti --platform 'linux/amd64' -v "$PWD:{{mount}}" {{tag}} just measure {{what}}

docker-measure-all:
docker run --rm -ti --platform 'linux/amd64' -v "$PWD/results:{{mount}}/results" {{tag}} just measure-all
docker run --rm -ti --platform 'linux/amd64' -v "$PWD:{{mount}}" {{tag}} just measure-all

measure-all:
#!/usr/bin/env bash
Expand All @@ -41,7 +41,7 @@ measure-all:
just measure "$lang";
done

node ./scripts/summary.js --results .
cd scripts && npm start

build what:
rm -f CMD VERSION
Expand Down
3 changes: 3 additions & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"type": "module",
"scripts": {
"start": "npm install && node summary.js --results ../results"
},
"dependencies": {
"human-readable": "^0.2.1",
"minimist": "^1.2.8",
Expand Down

0 comments on commit fae1f86

Please sign in to comment.