Skip to content

Commit

Permalink
Add all-tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbrisebois committed Nov 30, 2024
1 parent 9f4223a commit cbf02ed
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/all-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: All Tests

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Build Packages
run: |
nix develop --command make build
- name: Run Tests
run: |
output=$(DEBUG_LEVEL=trace nix develop --command bash -c 'make test | tee >(cat >&2); exit ${PIPESTATUS[0]}');
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit ${PIPESTATUS[0]}; fi
passing=$(echo "$output" | grep -oP '\d+ passing' | grep -oP '\d+' | awk '{sum+=$1} END {print sum}')
failing=$(echo "$output" | grep -oP '\d+ failing' | grep -oP '\d+' | awk '{sum+=$1} END {print sum}')
pending=$(echo "$output" | grep -oP '\d+ pending' | grep -oP '\d+' | awk '{sum+=$1} END {print sum}')
echo "## Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Passed | Failed | Pending |" >> $GITHUB_STEP_SUMMARY
echo "|----------|----------|----------|" >> $GITHUB_STEP_SUMMARY
echo "| $passing | $failing | $pending |" >> $GITHUB_STEP_SUMMARY
if [ "$failing" -ne 0 ]; then exit 1; fi

0 comments on commit cbf02ed

Please sign in to comment.