From 0423d6336644d1628e1568e72a76a012b63ab120 Mon Sep 17 00:00:00 2001 From: Nathan Clark Date: Sun, 13 Oct 2024 23:25:03 -0400 Subject: [PATCH] add workflow --- .github/workflows/nodejs.yml | 36 ++++++++++++++++++++++++++++++++++++ Makefile | 5 +++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/nodejs.yml create mode 100644 Makefile diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..8fcd6f6 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,36 @@ +name: Node.js CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install dependencies + run: make install + + - name: Run server + run: make run & + + - name: Wait for server to start + run: sleep 10 + + - name: Test server is running + run: curl -I http://localhost:3000 + + - name: Stop server + run: kill $(lsof -t -i:3000) || true \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4b9fbe6 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +install: + cd lsa-search-engine && npm install + +run: + cd lsa-search-engine && npm run start \ No newline at end of file