From fae1f8632440fc8560bc32d35ec566b84a23709b Mon Sep 17 00:00:00 2001 From: acheronfail Date: Wed, 10 Jan 2024 20:21:20 +1030 Subject: [PATCH] wip --- .github/workflows/ci.yml | 25 +++++++++---------------- Dockerfile | 38 ++++++++++++++++---------------------- justfile | 10 +++++----- scripts/package.json | 3 +++ 4 files changed, 33 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3166ee9..005c29d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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"] @@ -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: diff --git a/Dockerfile b/Dockerfile index 790b3de..0d4fecf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,20 +4,17 @@ 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 @@ -25,25 +22,22 @@ 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 diff --git a/justfile b/justfile index af37078..f1c9343 100644 --- a/justfile +++ b/justfile @@ -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) @@ -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 @@ -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 diff --git a/scripts/package.json b/scripts/package.json index 5788663..ed31a9d 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -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",