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

ci: add dialyzer on CI #77

Merged
merged 8 commits into from
Dec 31, 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[Build] Client"
name: "[Client] Build"

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[Build] Server"
name: "[Server] Build"

on:
push:
Expand Down Expand Up @@ -72,8 +72,8 @@ jobs:

- name: "[Database] Check Migrations"
run: |
nix develop .#ci --impure -c just db-up
nix develop .#ci --impure -c just dbu

- name: "[Database] Check Input Generation"
run: |
nix develop .#ci --impure -c just db-input
nix develop .#ci --impure -c just dbi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[Deploy] Server"
name: "[Server] Deploy"

on:
push:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/server_dialyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "[Server] Dialyzer"

on:
push:
branches: [ "master" ]
paths:
- .github/workflows/**
- server/**
- flake.nix
- flake.lock
pull_request:
branches: [ "master" ]
paths:
- .github/workflows/**
- server/**
- flake.nix
- flake.lock

permissions:
contents: read

jobs:
dialyzer:
name: Dialyzer
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true

- name: Install Nix
uses: cachix/install-nix-action@v26
with:
# Mostly to avoid GitHub rate limiting
extra_nix_config: |
access-tokens = github.com=${{ github.token }}

- name: Install Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: "[Server] Check Dialyzer"
run: |
nix develop .#ci --impure -c just d
7 changes: 4 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#+TITLE: Lyceum 🏛️

#+html: <a href="https://builtwithnix.org"><img alt="built with nix" src="https://builtwithnix.org/badge.svg" /></a><br>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/build_client.yml"> <img alt="[Build] Client" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/build_client.yml/badge.svg" /></a>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/build_server.yml"> <img alt="[Build] Server Client" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/build_server.yml/badge.svg" /></a>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/deploy_server.yml"> <img alt="[Deploy] Server Status" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/deploy_server.yml/badge.svg" /></a>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/client_build.yml"> <img alt="[Client] Build" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/client_build.yml/badge.svg" /></a><br>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/server_build.yml"> <img alt="[Server] Build" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/server_build.yml/badge.svg" /></a>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/server_dialyzer.yml"> <img alt="[Server] Dialyzer" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/server_dialyzer.yml/badge.svg" /></a>
#+html: <a href="https://github.com/Dr-Nekoma/lyceum/actions/workflows/server_deploy.yml"> <img alt="[Server] Deploy" src="https://github.com/Dr-Nekoma/lyceum/actions/workflows/server_deploy.yml/badge.svg" /></a>

* About

Expand Down
2 changes: 1 addition & 1 deletion client/build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
// the name of your project
.name = "lyceum-client",
.version = "0.0.1",
.version = "0.1.0",
.dependencies = .{
.@"raylib-zig" = .{
.url = "https://github.com/Not-Nik/raylib-zig/archive/58df62807f62bef1db79538d04b37b9f79909d0a.tar.gz",
Expand Down
121 changes: 85 additions & 36 deletions client/zon-deps.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,97 @@
# generated by zon2nix (https://github.com/Cloudef/zig2nix)

{ lib, linkFarm, fetchurl, fetchgit, runCommandLocal, zig, name ? "zig-packages" }:
{
lib,
linkFarm,
fetchurl,
fetchgit,
runCommandLocal,
zig,
name ? "zig-packages",
}:

with builtins;
with lib;

let
unpackZigArtifact = { name, artifact }: runCommandLocal name {
nativeBuildInputs = [ zig ];
} ''
hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
mv "$TMPDIR/p/$hash" "$out"
chmod 755 "$out"
'';
unpackZigArtifact =
{ name, artifact }:
runCommandLocal name
{
nativeBuildInputs = [ zig ];
}
''
hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
mv "$TMPDIR/p/$hash" "$out"
chmod 755 "$out"
'';

fetchZig = { name, url, hash }: let
artifact = fetchurl { inherit url hash; };
in unpackZigArtifact { inherit name artifact; };
fetchZig =
{
name,
url,
hash,
}:
let
artifact = fetchurl { inherit url hash; };
in
unpackZigArtifact { inherit name artifact; };

fetchGitZig = { name, url, hash }: let
parts = splitString "#" url;
url_base = elemAt parts 0;
url_without_query = elemAt (splitString "?" url_base) 0;
rev_base = elemAt parts 1;
rev = if match "^[a-fA-F0-9]{40}$" rev_base != null then rev_base else "refs/heads/${rev_base}";
in fetchgit {
inherit name rev hash;
url = url_without_query;
deepClone = false;
};

fetchZigArtifact = { name, url, hash }: let
parts = splitString "://" url;
proto = elemAt parts 0;
path = elemAt parts 1;
fetcher = {
"git+http" = fetchGitZig { inherit name hash; url = "http://${path}"; };
"git+https" = fetchGitZig { inherit name hash; url = "https://${path}"; };
http = fetchZig { inherit name hash; url = "http://${path}"; };
https = fetchZig { inherit name hash; url = "https://${path}"; };
file = unpackZigArtifact { inherit name; artifact = /. + path; };
fetchGitZig =
{
name,
url,
hash,
}:
let
parts = splitString "#" url;
url_base = elemAt parts 0;
url_without_query = elemAt (splitString "?" url_base) 0;
rev_base = elemAt parts 1;
rev = if match "^[a-fA-F0-9]{40}$" rev_base != null then rev_base else "refs/heads/${rev_base}";
in
fetchgit {
inherit name rev hash;
url = url_without_query;
deepClone = false;
};
in fetcher.${proto};
in linkFarm name [

fetchZigArtifact =
{
name,
url,
hash,
}:
let
parts = splitString "://" url;
proto = elemAt parts 0;
path = elemAt parts 1;
fetcher = {
"git+http" = fetchGitZig {
inherit name hash;
url = "http://${path}";
};
"git+https" = fetchGitZig {
inherit name hash;
url = "https://${path}";
};
http = fetchZig {
inherit name hash;
url = "http://${path}";
};
https = fetchZig {
inherit name hash;
url = "https://${path}";
};
file = unpackZigArtifact {
inherit name;
artifact = /. + path;
};
};
in
fetcher.${proto};
in
linkFarm name [
{
name = "1220df9aa89d657f5dca24ab0ac3d187f7a992a4d27461fd9e76e934bf0670ca9a90";
path = fetchZigArtifact {
Expand Down Expand Up @@ -75,4 +124,4 @@ in linkFarm name [
hash = "sha256-9dMtMC5c+nn6oYYmX/Xc8xIwG9m9/9Wym5lraK3BeI8=";
};
}
]
]
55 changes: 45 additions & 10 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading