From a40eefbe9a5301544369f8305519867c7ce0cae6 Mon Sep 17 00:00:00 2001 From: ReDBrother Date: Tue, 13 Feb 2024 04:14:48 +0300 Subject: [PATCH] fix jest action --- .github/workflows/main.yml | 38 ++++++++++++++++++-------------------- package.json | 3 +++ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db930ce..e23bfdb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,22 +23,27 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - - name: Get yarn cache - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '20' - - uses: actions/cache@v3 - id: yarn-cache + - name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-yarn- - + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- - name: Install yarn dependencies run: yarn install --froze-lockfile @@ -46,16 +51,14 @@ jobs: - name: Eslint run: yarn lint + - name: Run jest + run: yarn test + - name: Prettify code uses: creyD/prettier_action@v4.3 with: prettier_options: --write **/*.{js,md} - - name: Run jest - run: yarn test - - # - name: Setup db - - name: Login to Docker Hub run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --pasword-stdin @@ -63,8 +66,3 @@ jobs: run: make docker-build-chat-bot - name: Push docker image for codebattle bot run: make docker-push-chat-bot - - # - name: - # run: - # uses: - # with: diff --git a/package.json b/package.json index 81e8a3c..06962fd 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,9 @@ "prepare": "husky", "test": "jest" }, + "jest": { + "verbose": true + }, "repository": "git@github.com:hexlet-codebattle/codebattle_bot", "author": "ReDBrother ", "license": "MIT",