diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5c3faa3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +on: push +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v18 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - uses: purcell/setup-emacs@master + with: + version: 27.2 + - run: | + cat << 'EOF' > script.sh + #!/usr/bin/env bash + mkdir -p $(jupyter --runtime-dir) + jupyter --paths + jupyter --version + jupyter kernelspec list + + make dev + make compile + make test + EOF + + cat << EOF > shell.nix + { pkgs ? import {} }: + let + pypkgs = p: with p; [ + jupyter-core + jupyter-client + ipykernel + notebook + ]; + in pkgs.mkShell { + packages = [ + pkgs.pandoc + (pkgs.python3.withPackages pypkgs) + ]; + } + EOF + + git clone https://github.com/cask/cask ~/.cask + export PATH=$HOME/.cask/bin:$PATH + chmod +x script.sh + nix-shell --run ./script.sh