Skip to content
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
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
21 changes: 21 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Nix Checks

on:
push:
branches: [main]
pull_request:

jobs:
nix-build:
name: Nix Build
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: sudo mkdir -p /nix && sudo chown "$(id -u):$(id -g)" /nix
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: /nix
key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock') }}
restore-keys: nix-${{ runner.os }}-${{ runner.arch }}-
- uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
- run: nix develop --command true
29 changes: 29 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR Title

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
pr-title:
name: Conventional Commit
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Validate PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
pattern='^(feat|fix|refactor|ci|test|chore|docs|perf|style|build|revert)(\((core|renderer|deps)\))?!?: [a-z].+'
if [[ "$PR_TITLE" =~ $pattern ]]; then
echo "✓ $PR_TITLE"
else
echo "::error::PR title does not follow Conventional Commits format."
echo ""
echo "Expected: <type>(<scope>): <description>"
echo "Got: $PR_TITLE"
echo ""
echo "Allowed types: feat, fix, refactor, ci, test, chore, docs, perf, style, build, revert"
echo "Allowed scopes (optional): core, renderer, deps"
echo "Description must start with a lowercase letter."
exit 1
fi
91 changes: 91 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Rust Checks

on:
push:
branches: [main]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: Rustfmt (${{ matrix.package }})
runs-on: blacksmith-2vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
package: [tellur-core, tellur-renderer]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: sudo mkdir -p /nix && sudo chown "$(id -u):$(id -g)" /nix
- uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: /nix
key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock') }}
restore-keys: nix-${{ runner.os }}-${{ runner.arch }}-
- uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
- run: nix develop --command cargo fmt -p ${{ matrix.package }} -- --check

clippy:
name: Clippy (${{ matrix.package }})
runs-on: blacksmith-2vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
package: [tellur-core, tellur-renderer]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: sudo mkdir -p /nix && sudo chown "$(id -u):$(id -g)" /nix
- uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: /nix
key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock') }}
restore-keys: nix-${{ runner.os }}-${{ runner.arch }}-
- uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
- uses: useblacksmith/rust-cache@f53e7f127245d2a269b3d90879ccf259876842d5 # v3
with:
key: ${{ matrix.package }}
- run: nix develop --command cargo clippy --locked -p ${{ matrix.package }} -- -D warnings

build:
name: Build (${{ matrix.package }})
runs-on: blacksmith-2vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
package: [tellur-core, tellur-renderer]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: sudo mkdir -p /nix && sudo chown "$(id -u):$(id -g)" /nix
- uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: /nix
key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock') }}
restore-keys: nix-${{ runner.os }}-${{ runner.arch }}-
- uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
- uses: useblacksmith/rust-cache@f53e7f127245d2a269b3d90879ccf259876842d5 # v3
with:
key: ${{ matrix.package }}
- run: nix develop --command cargo build --locked -p ${{ matrix.package }}

test:
name: Test (${{ matrix.package }})
runs-on: blacksmith-2vcpu-ubuntu-2404
strategy:
fail-fast: false
matrix:
package: [tellur-core, tellur-renderer]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- run: sudo mkdir -p /nix && sudo chown "$(id -u):$(id -g)" /nix
- uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: /nix
key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock') }}
restore-keys: nix-${{ runner.os }}-${{ runner.arch }}-
- uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
- uses: useblacksmith/rust-cache@f53e7f127245d2a269b3d90879ccf259876842d5 # v3
with:
key: ${{ matrix.package }}
- run: nix develop --command cargo nextest run --locked -p ${{ matrix.package }} --no-tests=warn
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
target/
14 changes: 14 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[workspace]
members = ["tellur-core", "tellur-renderer"]
resolver = "2"
114 changes: 114 additions & 0 deletions flake.lock

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

41 changes: 41 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
fenix.url = "github:nix-community/fenix";
};

outputs =
{
self,
nixpkgs,
flake-utils,
fenix,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
rustToolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-gh/xTkxKHL4eiRXzWv8KP7vfjSk61Iq48x47BEDFgfk=";
};
in
{
devShells.default = pkgs.mkShell {
name = "tellur";

packages = [
rustToolchain
pkgs.cargo-watch
pkgs.cargo-nextest
pkgs.just
]
++ pkgs.lib.optionals pkgs.stdenv.isLinux [
pkgs.pkg-config
pkgs.mold
];
};
}
);
}
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.95.0"
components = ["cargo", "rustc", "rustfmt", "clippy", "rust-analyzer", "rust-src"]
4 changes: 4 additions & 0 deletions tellur-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[package]
name = "tellur-core"
version = "0.1.0"
edition = "2021"
1 change: 1 addition & 0 deletions tellur-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

7 changes: 7 additions & 0 deletions tellur-renderer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "tellur-renderer"
version = "0.1.0"
edition = "2021"

[dependencies]
tellur-core = { path = "../tellur-core" }
1 change: 1 addition & 0 deletions tellur-renderer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading