diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 753699c..b0ae186 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -7,6 +7,13 @@ on: - '**:**' jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v27 + - run: nix flake check + build: name: build runs-on: ubuntu-latest @@ -14,17 +21,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Setup Node - uses: actions/setup-node@v4.0.3 - with: - node-version: '18' - - - name: Display Node versions - run: | - node --version - npm --version - - name: Install dependencies - run: npm install - - - name: Test corpus & parse examples - run: npm test + - uses: cachix/install-nix-action@v27 + - run: nix build + - run: nix develop -c sh -c 'tree-sitter generate --no-bindings && tree-sitter test' diff --git a/flake.nix b/flake.nix index e86ab77..a4f8812 100644 --- a/flake.nix +++ b/flake.nix @@ -93,27 +93,15 @@ packages = { default = packages.tree-sitter-beancount; - tree-sitter-beancount = pkgs.callPackage (nixpkgs + "/pkgs/development/tools/parsing/tree-sitter/grammar.nix") {} { + tree-sitter-beancount = pkgs.tree-sitter.buildGrammar { language = "beancount"; + generate = true; src = ./.; - inherit (pkgs.tree-sitter) version; + version = "n/a"; }; inherit (pkgs) tree-sitter; }; } - ) - // { - overlays = { - default = final: prev: { - tree-sitter = prev.tree-sitter.override { - extraGrammars = { - tree-sitter-beancount = { - src = ./.; - }; - }; - }; - }; - }; - }; + ); }