From 29d7927f3ead7ee7c7a07475b102710f1dec04bc Mon Sep 17 00:00:00 2001 From: Martin Immanuel Burgos <miburgos@stud.ntnu.no> Date: Wed, 24 Mar 2021 08:30:31 +0000 Subject: [PATCH] Add new file --- .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d891bd5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +name: Frontend build-test and unit-tests + +on: + push: + branches: [main] + paths: + - "client/**" + - "!**.md" + pull_request: + branches: [main] + paths: + - "client/**" + - "!**.md" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: "15" + - name: Cache frontend node modules + id: cacheStep + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: client/node_modules + key: ${{ runner.os }}-build-${{ hashFiles('./client/package-lock.json') }} + + - name: Install frontend dependencie + if: steps.cacheStep.outputs.cache-hit != 'true' + run: cd client && npm install + + - name: Builds frontend + run: cd client && npm run build --if-present + + - name: Tests frontend + run: cd client && npm test -- GitLab