From a1af672c7c8738eb9ba02f8d680e2159712b0096 Mon Sep 17 00:00:00 2001 From: mikiher Date: Fri, 15 Mar 2024 08:50:51 +0200 Subject: [PATCH] Add unit test workflow --- .github/workflows/unit-tests.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..4c88c16e --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,30 @@ +name: Unit Tests + +on: + workflow_dispatch: + inputs: + branch: + description: 'Branch name' + required: true + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event_name != 'workflow_dispatch' && github.ref_name || inputs.branch}} + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test