Skip to content

Commit

Permalink
tests: add test case for luarocks test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 3, 2023
1 parent 72fd11f commit d7d94b8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,6 +16,7 @@ jobs:
- run: nix flake check -L

build:
needs: checks
name: ${{ matrix.attribute }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -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
10 changes: 7 additions & 3 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d7d94b8

Please sign in to comment.