Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add reasonable timeout on CI step #210

Merged
merged 8 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/demo.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/docs.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/garnix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Final Results"

on:
check_suite:
types: [completed]

jobs:
results:
name: Final Results
runs-on: ubuntu-latest
steps:
- run: echo
- run: exit 1
# see https://stackoverflow.com/a/67532120/4907315
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
|| contains(needs.*.result, 'skipped')
}}
27 changes: 0 additions & 27 deletions .github/workflows/test.yml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![Tests](https://github.com/ibizaman/selfhostblocks/actions/workflows/test.yml/badge.svg)](https://github.com/ibizaman/selfhostblocks/actions/workflows/test.yml)
[![Demo](https://github.com/ibizaman/selfhostblocks/actions/workflows/demo.yml/badge.svg)](https://github.com/ibizaman/selfhostblocks/actions/workflows/demo.yml)
[![Documentation](https://github.com/ibizaman/selfhostblocks/actions/workflows/docs.yml/badge.svg)](https://github.com/ibizaman/selfhostblocks/actions/workflows/docs.yml)
[![Tests](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgarnix.io%2Fapi%2Fbadges%2Fibizaman%2Fselfhostblocks)](https://garnix.io) (using Garnix)

SHB's (Self Host Blocks) is yet another server management tool whose goal is to provide a lower
entry-bar for self-hosting. SHB provides opinionated [building blocks](#available-blocks) fitting
Expand Down
2 changes: 1 addition & 1 deletion modules/services/nextcloud-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ in

environment.systemPackages = [
# Needed for a few apps. Would be nice to avoid having to put that in the environment and instead override https://github.com/NixOS/nixpkgs/blob/261abe8a44a7e8392598d038d2e01f7b33cf26d0/nixos/modules/services/web-apps/nextcloud.nix#L1035
pkgs.ffmpeg
pkgs.ffmpeg-headless

# Needed for the recognize app.
pkgs.nodejs
Expand Down
5 changes: 4 additions & 1 deletion test/vm/arr.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;
# TODO: Test login
commonTestScript = appname: { nodes, ... }:
let
Expand Down Expand Up @@ -44,7 +45,7 @@ let
raise Exception(f"Code is {response['code']}")
'';

basic = appname: pkgs.nixosTest {
basic = appname: pkgs.testers.runNixOSTest {
name = "arr-${appname}-basic";

nodes.server = { config, pkgs, ... }: {
Expand All @@ -58,6 +59,8 @@ let
../../modules/blocks/postgresql.nix
../../modules/blocks/nginx.nix
../../modules/services/arr.nix
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
];

shb.arr.${appname} = {
Expand Down
14 changes: 11 additions & 3 deletions test/vm/audiobookshelf.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;

# TODO: Test login
commonTestScript = { nodes, ... }:
let
Expand Down Expand Up @@ -38,11 +40,13 @@ let
'';
in
{
basic = pkgs.nixosTest {
basic = pkgs.testers.runNixOSTest {
name = "audiobookshelf-basic";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand All @@ -66,11 +70,13 @@ in
testScript = commonTestScript;
};

cert = pkgs.nixosTest {
cert = pkgs.testers.runNixOSTest {
name = "audiobookshelf-cert";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down Expand Up @@ -115,11 +121,13 @@ in
testScript = commonTestScript;
};

sso = pkgs.nixosTest {
sso = pkgs.testers.runNixOSTest {
name = "audiobookshelf-sso";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down
6 changes: 5 additions & 1 deletion test/vm/authelia.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;

ldapAdminPassword = "ldapAdminPassword";
in
{
basic = pkgs.nixosTest {
basic = pkgs.testers.runNixOSTest {
name = "authelia-basic";

nodes.machine = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down
10 changes: 8 additions & 2 deletions test/vm/grocy.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;

# TODO: Test login
commonTestScript = { nodes, ... }:
let
Expand Down Expand Up @@ -38,11 +40,13 @@ let
'';
in
{
basic = pkgs.nixosTest {
basic = pkgs.testers.runNixOSTest {
name = "grocy-basic";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand All @@ -65,11 +69,13 @@ in
testScript = commonTestScript;
};

cert = pkgs.nixosTest {
cert = pkgs.testers.runNixOSTest {
name = "grocy-cert";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down
18 changes: 14 additions & 4 deletions test/vm/jellyfin.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;

# TODO: Test login
commonTestScript = { nodes, ... }:
let
Expand Down Expand Up @@ -38,11 +40,13 @@ let
'';
in
{
basic = pkgs.nixosTest {
basic = pkgs.testers.runNixOSTest {
name = "jellyfin-basic";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand All @@ -66,11 +70,13 @@ in
testScript = commonTestScript;
};

ldap = pkgs.nixosTest {
ldap = pkgs.testers.runNixOSTest {
name = "jellyfin-ldap";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down Expand Up @@ -114,11 +120,13 @@ in
testScript = commonTestScript;
};

cert = pkgs.nixosTest {
cert = pkgs.testers.runNixOSTest {
name = "jellyfin_cert";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down Expand Up @@ -164,11 +172,13 @@ in
testScript = commonTestScript;
};

sso = pkgs.nixosTest {
sso = pkgs.testers.runNixOSTest {
name = "jellyfin_sso";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.backup = lib.mkOption { type = lib.types.anything; };
Expand Down
7 changes: 6 additions & 1 deletion test/vm/ldap.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;
in
{
auth = pkgs.nixosTest {
auth = pkgs.testers.runNixOSTest {
name = "ldap-auth";

nodes.server = { config, pkgs, ... }: {
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
shb.ssl.enable = lib.mkEnableOption "ssl";
Expand Down
6 changes: 5 additions & 1 deletion test/vm/lib.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ pkgs, lib, ... }:
let
pkgs' = pkgs;

shblib = pkgs.callPackage ../../lib {};
in
{
Expand Down Expand Up @@ -40,11 +42,13 @@ in
generator = lib.generators.toJSON {};
};
in
pkgs.nixosTest {
pkgs.testers.runNixOSTest {
name = "lib-template";
nodes.machine = { config, pkgs, ... }:
{
imports = [
(pkgs'.path + "/nixos/modules/profiles/headless.nix")
(pkgs'.path + "/nixos/modules/profiles/qemu-guest.nix")
{
options = {
libtest.config = lib.mkOption {
Expand Down
Loading