Skip to content

Use 4 test threads in Github CI #881

Use 4 test threads in Github CI

Use 4 test threads in Github CI #881

Workflow file for this run

name: Run checks
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18, 20]
postgres-version: ["13.10", "14.7", "15.2"]
redis-version: [6, 7]
services:
db:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_USER: freefeed
POSTGRES_PASSWORD: freefeed
POSTGRES_DB: freefeed_test
ports: ["5432:5432"]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Start Redis v${{ matrix.redis-version }}
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
- name: install GraphicsMagick
run: |
sudo apt-get update
sudo apt-get install graphicsmagick
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: create directories for attachments
run: |
mkdir -p /tmp/pepyatka-media/attachments
mkdir /tmp/pepyatka-media/attachments/thumbnails
mkdir /tmp/pepyatka-media/attachments/thumbnails2
mkdir /tmp/pepyatka-media/attachments/anotherTestSize
- name: Install dependencies
run: yarn
- name: run lint
run: yarn lint
- name: run tests
env:
TEST_THREADS: 4
run: yarn test