diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 804be02..948be37 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,38 @@ jobs: # run: | # make ghcup-build + # The same builds on macOS (Apple Silicon) and Linux on ARM. These do not + # deploy, so a failure here does not hold back the site. (Intel macOS is + # left out: nixpkgs has dropped x86_64-darwin.) + build-other: + strategy: + fail-fast: false + matrix: + os: [ macos-latest, ubuntu-24.04-arm ] + runs-on: ${{ matrix.os }} + timeout-minutes: 240 + + steps: + - uses: actions/checkout@v6 + + - uses: cachix/install-nix-action@v31 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install cachix + uses: cachix/cachix-action@v17 + with: + name: haskell-miso-cachix + + - name: Build WASM using Nix + run: nix develop .#wasm --command bash -c "make" + + - name: Build MicroHs using Nix + run: nix develop .#mhs --command bash -c "make mhs" + + - name: Build JS using Nix + run: nix develop .#ghcjs --command bash -c "make js" + deploy: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest diff --git a/flake.nix b/flake.nix index 1306fa8..8691a16 100644 --- a/flake.nix +++ b/flake.nix @@ -18,13 +18,22 @@ }; outputs = inputs: - inputs.miso.inputs.flake-utils.lib.eachDefaultSystem (system: { - devShell = inputs.miso.outputs.devShells.${system}.default; - devShells.hls = inputs.miso.outputs.devShells.${system}.hls; - devShells.wasm = inputs.miso.outputs.devShells.${system}.wasm; - devShells.ghcjs = inputs.miso.outputs.devShells.${system}.ghcjs; - devShells.mhs = inputs.miso.outputs.devShells.${system}.mhs; - }); + inputs.miso.inputs.flake-utils.lib.eachDefaultSystem (system: + let + pkgs = inputs.miso.inputs.nixpkgs.legacyPackages.${system}; + in { + devShell = inputs.miso.outputs.devShells.${system}.default; + devShells.hls = inputs.miso.outputs.devShells.${system}.hls; + devShells.wasm = inputs.miso.outputs.devShells.${system}.wasm; + # miso's, with hsc2hs: cabal needs it to build time (and other + # packages with .hsc files) for the JS backend. GitHub's + # ubuntu-latest image has one from GHCup on the PATH, macOS and + # Linux on ARM do not. + devShells.ghcjs = inputs.miso.outputs.devShells.${system}.ghcjs.overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.haskellPackages.hsc2hs ]; + }); + devShells.mhs = inputs.miso.outputs.devShells.${system}.mhs; + }); }