From d2512d324a3850562738b84575037b84fd6fcdd1 Mon Sep 17 00:00:00 2001 From: Lars Kiesow Date: Thu, 2 Feb 2023 00:38:35 +0100 Subject: [PATCH] Integration Test This patch adds a minimal integration test building Audiobookshelf as a binary, running it and checking if the server is available on each push and pull request. We can easily extend this with a Selenium or Playwright test later, but it should already alert us about problems in the build pipeline without the need for any developer to take a look at the new patches. --- .github/workflows/integration-test.yml | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/integration-test.yml diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 00000000..f88db2ed --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,44 @@ +name: Integration Test + +on: + pull_request: + push: + branches-ignore: + - 'dependabot/**' # Don't run dependabot branches, as they are already covered by pull requests + +jobs: + build: + name: build and test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: setup nade + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: install pkg + run: npm install -g pkg + + - name: get client dependencies + working-directory: client + run: npm ci + + - name: build client + working-directory: client + run: npm run generate + + - name: get server dependencies + run: npm ci --only=production + + - name: build binary + run: pkg -t node18-linux-x64 -o audiobookshelf . + + - name: run audiobookshelf + run: | + ./audiobookshelf & + sleep 5 + + - name: test if server is available + run: curl -sf http://127.0.0.1:3333 | grep Audiobookshelf