diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d072a04..2c279cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,12 @@ jobs: - name: Setup Zig uses: goto-bus-stop/setup-zig@v1.3.0 with: - version: master - - uses: nektro/actions-setup-zigmod - - name: Tests - run: ./test.sh + version: "0.9.0" + - run: zig version + - run: zig env + - uses: nektro/actions-setup-zigmod@v1 + - run: zigmod ci + - run: zig build test + - run: zig build + - run: cp zig-out/bin/skip . + - run: ./test.sh diff --git a/test.sh b/test.sh index f782546..313cf39 100755 --- a/test.sh +++ b/test.sh @@ -2,19 +2,6 @@ set -e -echo "zigmod" -zigmod ci - -echo "Unit tests..." -zig build test - -echo "Build..." -zig build - -echo -n "Created: " -ls zig-out/bin/skip -export PATH=$PWD/zig-out/bin/:$PATH - echo "> skip a line when reading from stdin" INPUT=$(cat< test.expect -echo "$INPUT" | skip 1 > test.out +echo "$INPUT" | ./skip 1 > test.out diff --brief test.expect test.out echo "> skip a line when reading from a file" @@ -31,7 +18,7 @@ line 1 line 2 EOF echo "line 2" > test.expect -skip 1 test.in > test.out +./skip 1 test.in > test.out diff --brief test.expect test.out echo "> skip until 2 matching lines seen" @@ -42,7 +29,7 @@ alpha gamma EOF echo "gamma" > test.expect -skip 2 test.in --line alpha > test.out +./skip 2 test.in --line alpha > test.out diff --brief test.expect test.out echo "> skip lines until 2 tokens seen" @@ -62,7 +49,7 @@ quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. EOF -skip 2 test.in --token dolor > test.out +./skip 2 test.in --token dolor > test.out diff --brief test.expect test.out rm test.in test.out test.expect