summaryrefslogtreecommitdiff
path: root/ci/default.nix
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-04 19:47:58 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-04 19:47:58 +0300
commit8d0d919fbf43230148da7533519ed0ffdfaa4197 (patch)
tree27e352d6ca09910e577ec27a10659814e88b15b9 /ci/default.nix
parentfce202465d4fede9e19d4d057eebbaa702291652 (diff)
downloadProject-Tick-8d0d919fbf43230148da7533519ed0ffdfaa4197.tar.gz
Project-Tick-8d0d919fbf43230148da7533519ed0ffdfaa4197.zip
NOISSUE add GitHub Actions scripts for PR preparation and review management
- Introduced `prepare.js` to validate PR mergeability and branch targeting. - Added `reviews.js` for automated review dismissal and posting. - Created `run` script to execute actions with GitHub context. - Implemented rate limiting in `withRateLimit.js` to manage API requests. - Added `supportedBranches.js` for branch classification logic. - Created `update-pinned.sh` for updating pinned dependencies. - Added `pinned.json` to manage pinned Nix dependencies. - Updated `libnbtplusplus` version from 2.3 to 3.0 and adjusted README accordingly. Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'ci/default.nix')
-rw-r--r--ci/default.nix93
1 files changed, 93 insertions, 0 deletions
diff --git a/ci/default.nix b/ci/default.nix
new file mode 100644
index 0000000000..3badcac036
--- /dev/null
+++ b/ci/default.nix
@@ -0,0 +1,93 @@
+let
+ pinned = (builtins.fromJSON (builtins.readFile ./pinned.json)).pins;
+in
+{
+ system ? builtins.currentSystem,
+ nixpkgs ? null,
+}:
+let
+ nixpkgs' =
+ if nixpkgs == null then
+ fetchTarball {
+ inherit (pinned.nixpkgs) url;
+ sha256 = pinned.nixpkgs.hash;
+ }
+ else
+ nixpkgs;
+
+ pkgs = import nixpkgs' {
+ inherit system;
+ config = { };
+ overlays = [ ];
+ };
+
+ fmt =
+ let
+ treefmtNixSrc = fetchTarball {
+ inherit (pinned.treefmt-nix) url;
+ sha256 = pinned.treefmt-nix.hash;
+ };
+ treefmtEval = (import treefmtNixSrc).evalModule pkgs {
+ projectRootFile = ".git/config";
+
+ settings.verbose = 1;
+ settings.on-unmatched = "debug";
+
+ programs.actionlint.enable = true;
+
+ programs.biome = {
+ enable = true;
+ validate.enable = false;
+ settings.formatter = {
+ useEditorconfig = true;
+ };
+ settings.javascript.formatter = {
+ quoteStyle = "single";
+ semicolons = "asNeeded";
+ };
+ settings.json.formatter.enabled = false;
+ };
+ settings.formatter.biome.excludes = [
+ "*.min.js"
+ ];
+
+ programs.keep-sorted.enable = true;
+
+ programs.nixfmt = {
+ enable = true;
+ package = pkgs.nixfmt;
+ };
+
+ programs.yamlfmt = {
+ enable = true;
+ settings.formatter = {
+ retain_line_breaks = true;
+ };
+ };
+
+ programs.zizmor.enable = true;
+ };
+ fs = pkgs.lib.fileset;
+ src = fs.toSource {
+ root = ../.;
+ fileset = fs.difference ../. (fs.maybeMissing ../.git);
+ };
+ in
+ {
+ shell = treefmtEval.config.build.devShell;
+ pkg = treefmtEval.config.build.wrapper;
+ check = treefmtEval.config.build.check src;
+ };
+
+in
+rec {
+ inherit pkgs fmt;
+ codeownersValidator = pkgs.callPackage ./codeowners-validator { };
+
+ shell = pkgs.mkShell {
+ packages = [
+ fmt.pkg
+ codeownersValidator
+ ];
+ };
+}