Add a GitHub test workflow

This commit is contained in:
Nathaniel Nicandro 2023-01-28 17:58:30 -06:00
parent dabcf2a5b8
commit 79cc6daa09

48
.github/workflows/test.yml vendored Normal file
View file

@ -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 <nixpkgs> {} }:
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