Skip to content

Commit

Permalink
Use nix run
Browse files Browse the repository at this point in the history
  • Loading branch information
WeetHet committed Aug 1, 2024
1 parent bc9eb16 commit f5f9a53
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-dafny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Run Dafny Tests
run: nix shell nixpkgs#dafny -c "scripts/dafny-test-all.sh"
run: nix run
58 changes: 58 additions & 0 deletions flake.lock

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

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
description = "Test dafny projects";

inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.default = pkgs.writeShellScriptBin "dafny-test-all" ''
for f in *.dfy
do
echo "Testing $f"
${pkgs.dafny}/bin/dafny verify --verification-time-limit 10 $f
done
'';
};
};
}
9 changes: 0 additions & 9 deletions scripts/dafny-test-all.sh

This file was deleted.

0 comments on commit f5f9a53

Please sign in to comment.