From 9afa2c9bfa07a6d60dd79537c16dbc034f7eb064 Mon Sep 17 00:00:00 2001 From: m-tartari <37861893+m-tartari@users.noreply.github.com> Date: Sat, 17 Feb 2024 18:27:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20chore(ci):=20add=20build=20workf?= =?UTF-8?q?low=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 35 +++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7e2bb8f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: build +on: + push: + branches: ['master'] + pull_request: {} + workflow_call: {} + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + name: Build + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 'lts/*' + cache: 'npm' + + - name: Install dependecies + run: npm ci + + - name: Build + run: npm run build + + - name: Test and generate coverage report + run: npm run test:coverage + + # TODO: upload coverage report to codecov + # - name: Upload coverage report to Codecov + # uses: codecov/codecov-action@v3 + # with: + # token: ${{ secrets.CODECOV_TOKEN }} diff --git a/package.json b/package.json index 57db009..ab351fd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "npm run lint -- --fix", "preview": "vite preview", - "test": "vitest" + "test": "vitest", + "test:coverage": "npm run test -- --coverage" }, "dependencies": { "@emotion/react": "^11.11.3",