From 96fdc1b900b982fa3aaaa8657b58818b7d75917f Mon Sep 17 00:00:00 2001 From: Brian Ryall Date: Wed, 27 Dec 2023 23:05:45 -0500 Subject: [PATCH] ci: switch to vusted for testing --- .github/workflows/ci.yml | 75 ++++------ .gitignore | 4 - flake.lock | 307 ++++----------------------------------- flake.nix | 33 +---- 4 files changed, 57 insertions(+), 362 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40fc3d1..076c33c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,57 +1,38 @@ -name: Tests +name: test -on: [push, pull_request] +on: + pull_request: jobs: - x64-ubuntu: - name: X64-ubuntu - runs-on: ubuntu-20.04 + test: + name: Run Test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] steps: - - uses: actions/checkout@v2 - - run: date +%F > todays-date - - name: Restore cache for today's nightly. - uses: actions/cache@v2 + - uses: actions/checkout@v4 + - uses: rhysd/action-setup-vim@v1 + id: vim with: - path: | - _neovim - key: ${{ runner.os }}-x64-${{ hashFiles('todays-date') }} + neovim: true + version: nightly - - name: Prepare - run: | - mkdir -p ~/.local/share/nvim/site/pack/vendor/start - git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim - ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start - - name: Run tests - run: | - curl -OL https://raw.githubusercontent.com/norcalli/bot-ci/master/scripts/github-actions-setup.sh - source github-actions-setup.sh nightly-x64 - make test - - appimage-ubuntu: - name: Appimage-ubuntu - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - run: date +%F > todays-date - - name: Restore cache for today's nightly. - uses: actions/cache@v2 + - name: luajit + uses: leafo/gh-actions-lua@v10 with: - path: | - build - key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }} + luaVersion: "luajit-2.1.0-beta3" + + - name: luarocks + uses: leafo/gh-actions-luarocks@v4 - - name: Prepare + - name: build run: | - test -d build || { - mkdir -p build - wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage - chmod +x nvim.appimage - mv nvim.appimage ./build/nvim - } - mkdir -p ~/.local/share/nvim/site/pack/vendor/start - git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim - ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start - - name: Run tests + luarocks install plenary + + - name: run test + shell: bash run: | - export PATH="${PWD}/build/:${PATH}" - make test + luarocks install luacheck + luarocks install vusted + vusted ./test diff --git a/.gitignore b/.gitignore index 26dc7e5..f9a759c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,2 @@ -.zshrc.bak .direnv .pre-commit-config.yaml -/luarocks -/lua_modules -/.luarocks diff --git a/flake.lock b/flake.lock index 494b6b3..c2f2a63 100644 --- a/flake.lock +++ b/flake.lock @@ -1,38 +1,6 @@ { "nodes": { "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -53,11 +21,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1698882062, - "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "type": "github" }, "original": { @@ -70,60 +38,6 @@ "inputs": { "systems": "systems" }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "inputs": { - "systems": "systems_3" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "inputs": { - "systems": "systems_4" - }, "locked": { "lastModified": 1685518550, "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", @@ -139,28 +53,6 @@ } }, "gitignore": { - "inputs": { - "nixpkgs": [ - "neorocks", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "gitignore_2": { "inputs": { "nixpkgs": [ "pre-commit-hooks", @@ -184,11 +76,11 @@ "neodev-nvim": { "flake": false, "locked": { - "lastModified": 1698818751, - "narHash": "sha256-cTK0InESf30wlDY/Qo7NkBXumG43rAoS/fE4jjRUK44=", + "lastModified": 1703570758, + "narHash": "sha256-tIRhHXu2rFIlTtXcHjEzWjqB4SZpTZch13VOecuplSA=", "owner": "folke", "repo": "neodev.nvim", - "rev": "80487e4f7bfa11c2ef2a1b461963db019aad6a73", + "rev": "029899ea32d3dc8ed8c910ceca2ee5d16e566c11", "type": "github" }, "original": { @@ -197,59 +89,13 @@ "type": "github" } }, - "neorocks": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils", - "neovim-nightly": "neovim-nightly", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": "pre-commit-hooks" - }, - "locked": { - "lastModified": 1698470714, - "narHash": "sha256-QhIzRWfyU1otL36F5adyh1BEPfWp5v5L3N9opPSCm0Q=", - "owner": "nvim-neorocks", - "repo": "neorocks", - "rev": "76fccbd50534fccab7ab244cdb4a08eddb78b9bc", - "type": "github" - }, - "original": { - "owner": "nvim-neorocks", - "repo": "neorocks", - "type": "github" - } - }, - "neovim-nightly": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": [ - "neorocks", - "nixpkgs" - ] - }, - "locked": { - "dir": "contrib", - "lastModified": 1698460938, - "narHash": "sha256-+IDg4xXSooalZAin/zuY3dSY+zX8Sid65MfN+CWRq1Y=", - "owner": "neovim", - "repo": "neovim", - "rev": "ac353e87aecf02315d82a3ad22725d2bc8140f0c", - "type": "github" - }, - "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1698336494, - "narHash": "sha256-sO72WDBKyijYD1GcKPlGsycKbMBiTJMBCnmOxLAs880=", + "lastModified": 1703499205, + "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "808c0d8c53c7ae50f82aca8e7df263225cf235bf", + "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", "type": "github" }, "original": { @@ -262,11 +108,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1698611440, - "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", "type": "github" }, "original": { @@ -293,46 +139,14 @@ "type": "github" } }, - "nixpkgs-stable_2": { - "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1699343069, - "narHash": "sha256-s7BBhyLA6MI6FuJgs4F/SgpntHBzz40/qV0xLPW6A1Q=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "ec750fd01963ab6b20ee1f0cb488754e8036d89d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "plenary-nvim": { "flake": false, "locked": { - "lastModified": 1697031827, - "narHash": "sha256-zR44d9MowLG1lIbvrRaFTpO/HXKKrO6lbtZfvvTdx+o=", + "lastModified": 1701343040, + "narHash": "sha256-f8YVaXMG0ZyW6iotAgnftaYULnL69UPolRad6RTG27g=", "owner": "nvim-lua", "repo": "plenary.nvim", - "rev": "50012918b2fc8357b87cff2a7f7f0446e47da174", + "rev": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0", "type": "github" }, "original": { @@ -343,45 +157,20 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_3", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": [ - "neorocks", "nixpkgs" ], "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1698227354, - "narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks_2": { - "inputs": { - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils_4", - "gitignore": "gitignore_2", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable_2" - }, - "locked": { - "lastModified": 1699271226, - "narHash": "sha256-8Jt1KW3xTjolD6c6OjJm9USx/jmL+VVmbooADCkdDfU=", + "lastModified": 1703426812, + "narHash": "sha256-aODSOH8Og8ne4JylPJn+hZ6lyv6K7vE5jFo4KAGIebM=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ea758da1a6dcde6dc36db348ed690d09b9864128", + "rev": "7f35ec30d16b38fe0eed8005933f418d1a4693ee", "type": "github" }, "original": { @@ -394,10 +183,9 @@ "inputs": { "flake-parts": "flake-parts", "neodev-nvim": "neodev-nvim", - "neorocks": "neorocks", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "plenary-nvim": "plenary-nvim", - "pre-commit-hooks": "pre-commit-hooks_2", + "pre-commit-hooks": "pre-commit-hooks", "telescope-nvim": "telescope-nvim" } }, @@ -416,59 +204,14 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_4": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "telescope-nvim": { "flake": false, "locked": { - "lastModified": 1699236417, - "narHash": "sha256-JZuEJKiWmoBC1KGjkgebi5zsWMyLmn+jSR633lHa2yQ=", + "lastModified": 1703697665, + "narHash": "sha256-HnRjfgJZ6DUcf79eibpmKNNsP8DMSPczD06ZoXiOtHk=", "owner": "nvim-telescope", "repo": "telescope.nvim", - "rev": "20bf20500c95208c3ac0ef07245065bf94dcab15", + "rev": "e0651458f2ced647f3ff3c89d5663244b3cf45af", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 70d84b8..4678ae5 100644 --- a/flake.nix +++ b/flake.nix @@ -3,7 +3,6 @@ inputs = { flake-parts.url = "github:hercules-ci/flake-parts"; - neorocks. url = "github:nvim-neorocks/neorocks"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; @@ -56,28 +55,16 @@ _module.args.pkgs = import inputs.nixpkgs { inherit system; overlays = [ - inputs.neorocks.overlays.default ]; }; devShells = { default = pkgs.mkShell { name = "haskell-tools.nvim-shell"; inherit (pre-commit-check) shellHook; - buildInputs = - with pkgs; [ - neorocks - haskellPackages.neolua-bin - stylua - ] - #++ (with inputs.pre-commit-hooks.packages.${system}; [ - # alejandra - # lua-language-server - # stylua - # luacheck - # markdownlint-cli - #]) - ; - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath []; + buildInputs = with pkgs; [ + luajitPackages.vusted + stylua + ]; }; }; @@ -114,18 +101,6 @@ inherit (inputs) pre-commit-hooks; inherit self; }; - neorocks-test-stable = pkgs.callPackage ./nix/neorocks-test.nix { - name = "git-worktree-stable"; - inherit self; - nvim = pkgs.neovim-unwrapped; - inherit (config.packages) plenary-plugin; - }; - neorocks-test-unstable = pkgs.callPackage ./nix/neorocks-test.nix { - name = "git-worktree-nightly"; - inherit self; - nvim = pkgs.neovim-nightly; - inherit (config.packages) plenary-plugin; - }; }; }; };