CI: Replace direnv with nix develop for hello-world job #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Benchmarks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| run-interpreted-benchmarks: | |
| runs-on: macos-15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - benchmark: run-shebangs-today | |
| chart-target: shebang-scripts/today/chart.svg | |
| artifact-name: today-chart | |
| artifact-path: shebang-scripts/today/chart.svg | |
| - benchmark: run-bucket-calc | |
| chart-target: bucket-calc/chart.svg | |
| artifact-name: bucket-calc-chart | |
| artifact-path: bucket-calc/chart.svg | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Set up APL | |
| run: brew install dyalog | |
| - name: Set up D | |
| run: brew install ldc dtools | |
| - name: Set up Dart | |
| run: | | |
| brew tap dart-lang/dart | |
| brew install dart | |
| - name: Set up Dotnet | |
| run: brew install --formula dotnet | |
| - name: Set up Deno | |
| run: brew install deno | |
| - name: Set up Elixir | |
| run: brew install elixir | |
| - name: Set up Elvish | |
| run: brew install elvish | |
| - name: Set up Emacs Lisp | |
| run: brew install emacs | |
| - name: Set up Erlang | |
| run: brew install erlang | |
| - name: Set up Factor | |
| run: brew install factor | |
| - name: Set up Fish | |
| run: brew install fish | |
| - name: Set up Forth | |
| run: brew install gforth | |
| - name: Set up GNU Smalltalk | |
| run: brew install gnu-smalltalk | |
| - name: Set up Godot for GDScript | |
| run: brew install godot | |
| - name: Set up Groovy | |
| run: brew install groovy | |
| - name: Set up Guile | |
| run: brew install guile | |
| - name: Set up Haxe | |
| run: brew install haxe | |
| - name: Set up J | |
| run: brew install j | |
| - name: Set up Janet | |
| run: brew install janet | |
| - name: Set up Java | |
| run: brew install java | |
| - name: Set up Julia | |
| run: brew install --formula julia | |
| - name: Set up Jq | |
| run: brew install jq | |
| - name: Set up Lua | |
| run: brew install lua | |
| - name: Set up Luajit | |
| run: brew install luajit | |
| - name: Set up Luau | |
| run: brew install luau | |
| - name: Set up Ngs | |
| run: brew install ngs | |
| - name: Set up Nickel | |
| run: brew install nickel | |
| - name: Set up Nim | |
| run: brew install nim | |
| - name: Set up Nix | |
| uses: cachix/install-nix-action@v31 | |
| # - name: Set up Nim | |
| # run: brew install nim | |
| - name: Set up Nushell | |
| run: brew install nushell | |
| - name: Set up OCaml | |
| run: brew install ocaml | |
| - name: Set up Osh | |
| run: brew install osh | |
| - name: Set up Php | |
| run: brew install php | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| check-latest: true | |
| - name: Set up R | |
| run: brew install --formula r | |
| - name: Set up Racket | |
| run: brew install --cask racket | |
| - name: Set up Rust-Script | |
| run: cargo install rust-script | |
| - name: Set up Roc | |
| uses: hasnep/setup-roc@main | |
| - name: Set up Scala | |
| run: | | |
| brew install scala | |
| brew install Virtuslab/scala-cli/scala-cli | |
| - name: Set up SWI-Prolog | |
| run: brew install swi-prolog | |
| - name: Set up Haskell's Stack | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| enable-stack: true | |
| - name: Install TCL | |
| run: brew install tcl-tk | |
| - name: Set up Typst | |
| run: brew install typst | |
| - name: Set up Uiua | |
| run: cargo install --git https://github.com/uiua-lang/uiua uiua | |
| - name: Set up V | |
| uses: vlang/setup-v@v1.4 | |
| - name: Install Hyperfine | |
| run: brew install hyperfine | |
| - name: Print versions | |
| if: matrix.benchmark == 'run-shebangs-today' | |
| run: make print-versions | |
| - name: Run benchmark | |
| run: make ${{ matrix.benchmark }} | |
| - name: Generate chart | |
| run: make -B ${{ matrix.chart-target }} | |
| - name: Upload chart | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact-name }} | |
| path: ${{ matrix.artifact-path }} | |
| run-hello-world: | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Set up Nix | |
| uses: cachix/install-nix-action@v31 | |
| - name: Run hello world benchmark | |
| run: nix develop --command make run-hello-world | |
| - name: Generate chart | |
| run: make -B compiled/hello_world/hello-world-chart.svg | |
| - name: Upload chart | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hello-world-chart | |
| path: compiled/hello_world/hello-world-chart.svg | |
| commit-charts: | |
| needs: [run-interpreted-benchmarks, run-hello-world] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download today chart | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: today-chart | |
| path: shebang-scripts/today/ | |
| - name: Download bucket-calc chart | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: bucket-calc-chart | |
| path: bucket-calc/ | |
| - name: Download hello-world chart | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: hello-world-chart | |
| path: compiled/hello_world/ | |
| - name: Commit and push updated charts | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add shebang-scripts/today/chart.svg | |
| git add compiled/hello_world/hello-world-chart.svg | |
| git add bucket-calc/chart.svg | |
| git commit -m "Update benchmark charts [skip ci]" || echo "No changes to commit" | |
| git push |