From 217ee3118feaceba78845ee50b01f97bf07c4a18 Mon Sep 17 00:00:00 2001 From: Chafik H'nini Date: Thu, 21 Mar 2024 16:57:41 +0100 Subject: [PATCH] chore: setup quality job --- .github/workflows/quality.yml | 37 +++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..dc8f95d --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,37 @@ +name: quality +# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push +on: [push] +jobs: + main: + # https://github.com/actions/runner-images + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v1 + + # https://github.com/actions/cache/blob/main/examples.md#node---yarn + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Uncache Yarn dependencies + uses: actions/cache@v2 + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + **/node_modules + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: | + yarn install + + - name: Lint + run: | + yarn lint:ci + + - name: Test + run: | + yarn test:ci diff --git a/package.json b/package.json index 2da9099..d49dbc7 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.1.0", "scripts": { "lint": "eslint . --ext .js,.jsx,.ts,.tsx --cache --debug --fix && prettier --write '**/*.json'", - "lint:ci": "eslint . --ext .js,.jsx,.ts,.tsx && prettier '**/*.json'" + "lint:ci": "eslint . --ext .js,.jsx,.ts,.tsx && prettier '**/*.json'", + "test:ci": "tsc" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.3.1",