Skip to content

Commit

Permalink
workflows: just run specs
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Aug 28, 2023
1 parent cb8f17a commit 9681b5b
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 12 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@ jobs:
with:
version: 0.11.0
- run: make spec
id: spec-runner
- uses: LouisBrunner/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Specs ${{ steps.spec-runner.outputs.specs-succeeded }}/${{ steps.spec-runner.outputs.spec-count }}
conclusion: ${{ steps.spec-runner.outputs.conclusion }}
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ test:

spec:
zig build
temp_file=$$(mktemp); \
(cd vendor/cmark-gfm/test && python3 spec_tests.py --program=../../../zig-out/bin/koino 2>&1) | tee $$temp_file; \
printf "::set-output name=specs-succeeded::"; tail -n 1 $$temp_file | perl -pne '/(\d+) passed, (\d+) failed, (\d+) errored, (\d+) skipped/; $$_ = $$1'; \
printf "\n::set-output name=spec-count::"; tail -n 1 $$temp_file | perl -pne '/(\d+) passed, (\d+) failed, (\d+) errored, (\d+) skipped/; $$_ = $$1 + $$2 + $$3 + $$4'; \
printf "\n::set-output name=conclusion::"; tail -n 1 $$temp_file | perl -pne '/(\d+) passed, (\d+) failed, (\d+) errored, (\d+) skipped/; $$_ = ($$2 + $$3 > 0) ? "failure" : "success"'; \
printf "\n"
cd vendor/cmark-gfm/test && python3 spec_tests.py --program=../../../zig-out/bin/koino
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.

30 changes: 30 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
outputs = {
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) lib;
in rec {
checks.default = pkgs.stdenv.mkDerivation {
name = "koino-build";

src = ./.;

nativeBuildInputs = [pkgs.zig pkgs.pcre];

buildPhase = ''
export ZIG_GLOBAL_CACHE_DIR="$TMPDIR/zig"
zig build test
touch $out
'';
};

formatter = pkgs.alejandra;

devShells.default = checks.default;
});
}

0 comments on commit 9681b5b

Please sign in to comment.