Skip to content

Commit

Permalink
add test action
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Grubenmann committed Jan 3, 2024
1 parent fe349d7 commit 8abaa2c
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run Tests
on:
pull_request:
types: [ opened, reopened, synchronize ]
branches:
- "**"
- "!master"
push:
branches:
- master
tags:
- "v*.*.*"
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install fuse
run: |
sudo apt-get update
sudo apt-get install -y fuse3
sudo bash -c 'echo "user_allow_other" >> /etc/fuse.conf'
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Flake check
run: nix flake check
- name: Run tests
uses: workflow/[email protected]
with:
flakes-from-devshell: true
script: |
init-kind-cluster
local-deploy
get-kind-kubeconfig
go test -v ./...
- name: Print rclone log
if: ${{ failure() }}
run: cat /tmp/rclone.log


4 changes: 3 additions & 1 deletion devenv/nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ let
optionalPkgs = with pkgs; if stdenv.isDarwin then [
macfuse-stubs
] else [];
scripts = import ./scripts.nix { inherit pkgs; };
inherit (scripts) initKindCluster deleteKindCluster getKindKubeconfig localDeployScript reloadScript;
in
pkgs.mkShell {
packages = with pkgs; [
Expand Down Expand Up @@ -38,7 +40,7 @@ pkgs.mkShell {
# Nix
nil # LSP
nixfmt # Formatter
] ++ optionalPkgs;
] ++ optionalPkgs ++ [initKindCluster deleteKindCluster getKindKubeconfig localDeployScript reloadScript];

shellHook = ''
export PROJECT_ROOT="$(pwd)"
Expand Down

0 comments on commit 8abaa2c

Please sign in to comment.