Work on adding some basic CI
This commit is contained in:
parent
f9bedc374e
commit
a4ed3b922f
9
.forgejo/workflows/build.yaml
Normal file
9
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: beefcake
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: nix flake check
|
||||||
|
run: 'nix flake check'
|
1769
Cargo.lock
generated
1769
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
30
Cargo.toml
30
Cargo.toml
|
@ -3,12 +3,32 @@ name = "kodotag-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# bevy = { version = "0.13.2", features = ["wav"] }
|
bevy = { version = "0.14.0", default-features = false, features = [
|
||||||
bevy = { version = "0.13.2", features = ["wayland", "wav"] }
|
"bevy_asset",
|
||||||
# bevy = { version = "0.12.1", features = ["wayland", "file_watcher", "trace"] }
|
"bevy_audio",
|
||||||
|
"bevy_color",
|
||||||
|
"bevy_core_pipeline",
|
||||||
|
"bevy_gizmos",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_sprite",
|
||||||
|
"bevy_text",
|
||||||
|
"bevy_ui",
|
||||||
|
"bevy_winit",
|
||||||
|
"multi_threaded",
|
||||||
|
"png",
|
||||||
|
"sysinfo_plugin",
|
||||||
|
"x11",
|
||||||
|
"file_watcher",
|
||||||
|
"trace",
|
||||||
|
# "track_change_detection",
|
||||||
|
# "serialize"
|
||||||
|
# "bevy_dev_tools",
|
||||||
|
# "detailed_trace",
|
||||||
|
"dynamic_linking",
|
||||||
|
"wayland",
|
||||||
|
"wav",
|
||||||
|
] }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
opt-level = 1
|
opt-level = 1
|
||||||
|
|
83
flake.lock
83
flake.lock
|
@ -1,12 +1,72 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1696426674,
|
||||||
|
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"git-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1721042469,
|
||||||
|
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"gitignore": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"git-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709087332,
|
||||||
|
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715787315,
|
"lastModified": 1722185531,
|
||||||
"narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=",
|
"narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5",
|
"rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -16,8 +76,25 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-stable": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1720386169,
|
||||||
|
"narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "194846768975b7ad2c4988bdb82572c00222c0d7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-24.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
70
flake.nix
70
flake.nix
|
@ -1,46 +1,74 @@
|
||||||
{
|
{
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
git-hooks.url = "github:cachix/git-hooks.nix";
|
||||||
|
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
|
git-hooks,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
}: let
|
}: let
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
supportedSystems = ["x86_64-linux"];
|
inherit (outputs) overlays;
|
||||||
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
|
|
||||||
|
systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"];
|
||||||
|
forSystems = nixpkgs.lib.genAttrs systems;
|
||||||
|
pkgsFor = system: (import nixpkgs {inherit system;}).extend overlays.default;
|
||||||
|
genPkgs = func: (forSystems (system: func (pkgsFor system)));
|
||||||
in {
|
in {
|
||||||
devShells = forEachSupportedSystem (system: let
|
checks = genPkgs ({system, ...}: {
|
||||||
pkgs = import nixpkgs {inherit system;};
|
git-hooks = git-hooks.lib.${system}.run {
|
||||||
in {
|
src = ./.;
|
||||||
# TODO: maybe use nightly?
|
hooks = {
|
||||||
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#using-rust-nightly-with-nix-shell-using-rust-nightly-with-nix-shell
|
alejandra.enable = true;
|
||||||
# TODO: packages
|
cargo-check.enable = true;
|
||||||
# TODO: checks
|
clippy.enable = true;
|
||||||
rust-dev = pkgs.mkShell rec {
|
rustfmt.enable = true;
|
||||||
nativeBuildInputs = with pkgs; [pkg-config];
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
packages = genPkgs (pkgs: {
|
||||||
|
kodotag = pkgs.rustPlatform.buildRustPackage {
|
||||||
|
pname = "kodotag";
|
||||||
|
version = "0.1.0";
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
clang
|
clang
|
||||||
cargo
|
cargo
|
||||||
rustc
|
rustc
|
||||||
rustfmt
|
rustfmt
|
||||||
rustPackages.clippy
|
rustPackages.clippy
|
||||||
rust-analyzer
|
|
||||||
mold
|
|
||||||
|
|
||||||
# source: https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md#nix
|
|
||||||
udev
|
|
||||||
alsa-lib
|
|
||||||
vulkan-loader
|
|
||||||
xorg.libX11
|
xorg.libX11
|
||||||
xorg.libXcursor
|
xorg.libXcursor
|
||||||
xorg.libXi
|
xorg.libXi
|
||||||
xorg.libXrandr
|
xorg.libXrandr
|
||||||
|
rust-analyzer
|
||||||
|
mold
|
||||||
|
udev
|
||||||
|
alsa-lib
|
||||||
|
vulkan-loader
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
wayland
|
wayland
|
||||||
];
|
];
|
||||||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
|
|
||||||
|
src = ./.;
|
||||||
|
hash = pkgs.lib.fakeHash;
|
||||||
|
cargoHash = "sha256-W7VQlMktGsRPQL9VGVmxYV6C5u2eJ48S7eTpOM+3n8U=";
|
||||||
};
|
};
|
||||||
|
|
||||||
default = outputs.devShells.${system}.rust-dev;
|
default = outputs.packages.${pkgs.system}.kodotag;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
overlays = {
|
||||||
|
default = final: prev: {};
|
||||||
|
};
|
||||||
|
|
||||||
|
formatter = genPkgs (p: p.alejandra);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue