From 43639bb99b535e2d1ff47f9c17fad85bfe94d4d9 Mon Sep 17 00:00:00 2001 From: Alex Stewart Date: Thu, 12 Sep 2024 13:14:57 -0400 Subject: [PATCH] .github: add PR test Add a PR testing workflow where we can start to add autotests. At the moment, it just checks that the Makefile workflows function, but it could be expanded to include unit tests and (if we get a NILRT runner) integration tests. Signed-off-by: Alex Stewart --- .github/workflows/pr-test.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/pr-test.yml diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml new file mode 100644 index 0000000..85ec15c --- /dev/null +++ b/.github/workflows/pr-test.yml @@ -0,0 +1,45 @@ +name: PR Testing + +on: [pull_request] + +jobs: + make-workflows: + runs-on: ubuntu-latest + + env: + DESTDIR: /tmp/nilrt-snac + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history so that git-describe works + - run: make all + - name: make install + run: | + make install + tree -ap "${DESTDIR}" + - name: make uninstall + run: | + make uninstall + tree -ap "${DESTDIR}" + + leftover_files=false + find "${DESTDIR}" -type f >./leftover_files + + while read file; do + echo "ERROR: leftover file: ${file}" + leftover_files=true + done <./leftover_files + + if $leftover_files; then + echo "ERROR: uninstall did not remove all files." + cat ./leftover_files + exit 1 + else + echo "OK" + fi + - name: make dist + run: | + make dist + tar --list -f ./nilrt-snac-*.tar.gz