diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e23bfdb..af2aa6f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,9 +60,9 @@ jobs: prettier_options: --write **/*.{js,md} - name: Login to Docker Hub - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --pasword-stdin + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin - name: Build docker image for codebattle bot - run: make docker-build-chat-bot + run: make docker-build - name: Push docker image for codebattle bot - run: make docker-push-chat-bot + run: make docker-push diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0f34c8b..4f63c7c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -23,20 +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 - 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 + - name: Cache node modules + uses: actions/cache@v4 + env: + cache-name: cache-node-modules with: - path: ${{ steps.yarn-cache.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 @@ -44,10 +51,10 @@ 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