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

chore: write a workflow for running tests #78

Closed
wants to merge 2 commits into from
Closed
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
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Tests

on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*'
pull_request:

jobs:
test:
name: Run Tests
steps:
- name: git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Nix
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
- name: Test
run: |
nix develop --command run-tests
27 changes: 27 additions & 0 deletions flake.lock

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

48 changes: 48 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

{
description = "sdk-internal";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
...
}: let
supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forAllSystemTypes = fn: nixpkgs.lib.genAttrs supportedSystems fn;
in {
devShells = forAllSystemTypes (system: let
pkgs = import nixpkgs {inherit system;};
in {
default = pkgs.mkShell {
inputsFrom = with self.devShells.${system}; [
building
];
};
building = let
runBuild = (pkgs.writeScriptBin "run-build" ''
cargo build
'');
runTests = (pkgs.writeScriptBin "run-tests" ''
cargo test
'');
in
pkgs.mkShell {
buildInputs = [
pkgs.rustup
pkgs.cargo
];
packages = [
runBuild
runTests
];
shellHook = ''
rustup default nightly
'';
};
});
};
}


Loading