Skip to content

Commit a40eefb

Browse files
committed
fix jest action
1 parent fb6ee1d commit a40eefb

2 files changed

Lines changed: 21 additions & 20 deletions

File tree

.github/workflows/main.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,46 @@ jobs:
2323
2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
with:
2828
ref: ${{ github.head_ref }}
2929

30-
- name: Get yarn cache
31-
id: yarn-cache-dir-path
32-
run: echo "::set-output name=dir::$(yarn cache dir)"
30+
- name: Setup node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '20'
3334

34-
- uses: actions/cache@v3
35-
id: yarn-cache
35+
- name: Cache node modules
36+
uses: actions/cache@v4
37+
env:
38+
cache-name: cache-node-modules
3639
with:
37-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
38-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
40+
# npm cache files are stored in `~/.npm` on Linux/macOS
41+
path: ~/.npm
42+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
3943
restore-keys: |
40-
${{ runner.os }}-yarn-
41-
44+
${{ runner.os }}-build-${{ env.cache-name }}-
45+
${{ runner.os }}-build-
46+
${{ runner.os }}-
4247
4348
- name: Install yarn dependencies
4449
run: yarn install --froze-lockfile
4550

4651
- name: Eslint
4752
run: yarn lint
4853

54+
- name: Run jest
55+
run: yarn test
56+
4957
- name: Prettify code
5058
uses: creyD/prettier_action@v4.3
5159
with:
5260
prettier_options: --write **/*.{js,md}
5361

54-
- name: Run jest
55-
run: yarn test
56-
57-
# - name: Setup db
58-
5962
- name: Login to Docker Hub
6063
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --pasword-stdin
6164

6265
- name: Build docker image for codebattle bot
6366
run: make docker-build-chat-bot
6467
- name: Push docker image for codebattle bot
6568
run: make docker-push-chat-bot
66-
67-
# - name:
68-
# run:
69-
# uses:
70-
# with:

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"prepare": "husky",
1515
"test": "jest"
1616
},
17+
"jest": {
18+
"verbose": true
19+
},
1720
"repository": "git@github.com:hexlet-codebattle/codebattle_bot",
1821
"author": "ReDBrother <bataevdmitriy@gmail.com>",
1922
"license": "MIT",

0 commit comments

Comments
 (0)