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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
23 changes: 9 additions & 14 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: Rust
name: CI
permissions:
contents: read

on:
pull_request:
Expand All @@ -14,20 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1
# Install Nix
- uses: cachix/install-nix-action@v27
with:
toolchain: stable
targets: wasm32-unknown-unknown
components: clippy, rustfmt
github_access_token: ${{ secrets.GITHUB_TOKEN }}

# Install Just to run CI scripts
- uses: extractions/setup-just@v3

# Cargo binstall is used to install tools faster than compiling them from source.
- uses: cargo-bins/cargo-binstall@main
- run: just setup-tools
# Set RUSTFLAGS
- run: echo "RUSTFLAGS=--cfg=web_sys_unstable_apis" >> $GITHUB_ENV

# Make sure u guys don't write bad code
- run: just check
- run: just test
- run: nix develop --command just check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target
Cargo.lock
.direnv/
61 changes: 61 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 @@
{
description = "Web Transport development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };

tools = [
pkgs.rustc
pkgs.cargo
pkgs.rustfmt
pkgs.clippy
pkgs.cargo-shear
pkgs.cargo-sort
pkgs.cargo-edit
pkgs.cargo-hack
pkgs.just
pkgs.pkg-config
pkgs.glib
pkgs.gtk3
];
in
{
devShells.default = pkgs.mkShell {
packages = tools;
};
}
);
}