Skip to content

Commit

Permalink
feat(ci: tests): add CI for running unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d4ilyrun committed May 8, 2024
1 parent a792ba2 commit 9a62281
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Testing

on:
pull_request:
push:
branches:
- master

jobs:

tests:
name: Run tests
runs-on: ubuntu-latest

steps:

- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive

# We use nix flakes to setup environment
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Test
run: |
nix develop .#test --command meson test -C build --print-errorlogs
8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@
hardeningDisable = [ "fortify" ];
};

tests = pkgs.mkShell rec {
test = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
# Bulding
gnumake
ninja
meson
nasm
# Testing
criterion.out
criterion.dev
Expand All @@ -79,6 +80,11 @@

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath nativeBuildInputs;
hardeningDisable = [ "fortify" ];

shellHook = ''
export BUILD_DIR=build
meson setup --cross-file ./scripts/meson_cross.ini --reconfigure -Dbuildtype=debug "./$BUILD_DIR"
'';
};

};
Expand Down

0 comments on commit 9a62281

Please sign in to comment.