diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 82d96b2..c8577b0 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -5,6 +5,7 @@ on: jobs: checks: runs-on: ubuntu-latest + name: Nix checks steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v20 @@ -15,6 +16,7 @@ jobs: - run: nix flake check -L build: + needs: checks name: ${{ matrix.attribute }} / ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: @@ -28,4 +30,29 @@ jobs: steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v20 - - run: nix build "${{matrix.attribute}}" -L + - run: nix build --accept-flake-config "${{matrix.attribute}}" -L + + tests: + needs: build + runs-on: ubuntu-latest + name: Integration test + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v20 + - uses: cachix/cachix-action@v12 + with: + name: mrcjkb + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Run integration tests + run: | + nix profile install --accept-flake-config ".#neorocks" + cd testproject + luarocks init + luarocks config --scope project lua_interpreter neorocks + luarocks test + rm -r lua_modules/ .luarocks/ luarocks + luarocks init + luarocks config --scope project lua_interpreter neorocks-nightly + luarocks test + shell: bash diff --git a/nix/overlay.nix b/nix/overlay.nix index c11973d..f8193e6 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -68,15 +68,19 @@ with final.lib; let nativeBuildInputs = with final; [pkgs.makeWrapper pkgs.installShellFiles luajit pkgs.unzip]; }); - neorocks = final.pkgs.symlinkJoin { - name = "neorocks"; - paths = [ + neorocks = final.pkgs.writeShellApplication { + name = "luarocks"; + runtimeInputs = [ luarocks luajit luajit.pkgs.dkjson neolua-stable-wrapper neolua-nightly-wrapper ]; + checkPhase = ""; + text = '' + luarocks "$@"; + ''; }; in { inherit