Skip to content

Commit

Permalink
build: some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoliaots committed Sep 20, 2024
1 parent 470f6dc commit 1fbb5c3
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 62 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ root = true

[*]
indent_style = space
indent_size = 2
indent_size = 2
charset = utf-8
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

39 changes: 18 additions & 21 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
name: testing
name: Testing
on:
pull_request:
branches:
- main
jobs:
test:
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: Node ${{ matrix.node_version }}
runs-on: ubuntu-22.04
strategy:
matrix:
os:
- ubuntu-22.04
node_version:
- 14
- 16
- 18
architecture:
- x64
- 20
- 22
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: latest
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
check-latest: true
architecture: ${{ matrix.architecture }}
- run: docker compose up -d
- run: docker compose exec -T cluster-1_master-1 redis-cli --cluster create 127.0.0.1:16380 127.0.0.1:16381 127.0.0.1:16382 --cluster-yes
- run: docker compose exec -T cluster-2_master-1 redis-cli --cluster create 127.0.0.1:16480 127.0.0.1:16481 127.0.0.1:16482 --cluster-yes
architecture: x64
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Run docker-compose
uses: hoverkraft-tech/[email protected]
with:
compose-file: './compose.yaml'
- run: docker compose exec cluster-m1 redis-cli -a mycluster --cluster create 127.0.0.1:7380 127.0.0.1:7381 127.0.0.1:7382 --cluster-yes
- run: pnpm install --frozen-lockfile
- run: pnpm -F "@liaoliaots/nestjs-redis" lint
- run: pnpm -F "@liaoliaots/nestjs-redis" test
- run: pnpm -F "@liaoliaots/nestjs-redis" test:e2e
- run: pnpm -F "@liaoliaots/nestjs-redis-health" lint
- run: pnpm -F "@liaoliaots/nestjs-redis-health" test
- run: pnpm -F "@liaoliaots/nestjs-redis-health" test:e2e
- run: docker compose down -v
11 changes: 0 additions & 11 deletions .prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
printWidth: 120
tabWidth: 2
singleQuote: true
trailingComma: none
arrowParens: avoid
endOfLine: auto
8 changes: 4 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ services:
image: redis/redis-stack-server:latest
network_mode: host
environment:
- 'REDIS_ARGS=--port 6380 --requirepass myredis --appendonly yes'
- 'REDIS_ARGS=--port 6380 --requirepass myredis'
cluster-m1:
image: redis:latest
network_mode: host
command: 'redis-server --port 7380 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes'
command: 'redis-server --port 7380 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
cluster-m2:
image: redis:latest
network_mode: host
command: 'redis-server --port 7381 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes'
command: 'redis-server --port 7381 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
cluster-m3:
image: redis:latest
network_mode: host
command: 'redis-server --port 7382 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf --appendonly yes'
command: 'redis-server --port 7382 --requirepass mycluster --cluster-enabled yes --cluster-config-file nodes.conf'
15 changes: 8 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ import prettier from 'eslint-plugin-prettier/recommended';
// @ts-ignore
import jest from 'eslint-plugin-jest';

const jestFiles = ['packages/*/test/**/*', 'packages/**/*.spec.ts'];

export default tseslint.config(
{
ignores: ['.prettierrc.js', 'eslint.config.js', 'sample', '**/dist', 'packages/*/*.js']
ignores: ['eslint.config.js', 'sample/', '**/dist/', 'packages/*/*.js']
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
files: ['packages/**/test/**', 'packages/**/*.spec.ts'],
files: jestFiles,
...jest.configs['flat/recommended']
},
{
files: ['packages/**/test/**', 'packages/**/*.spec.ts'],
files: jestFiles,
...jest.configs['flat/style']
},
prettier,
Expand All @@ -28,12 +30,11 @@ export default tseslint.config(
...globals.jest
},
parserOptions: {
project: ['./packages/*/tsconfig.json'],
ecmaVersion: 2023,
projectService: true,
tsconfigRootDir: import.meta.dirname
}
}
},
{
},
linterOptions: {
reportUnusedDisableDirectives: true
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@nestjs/common": "10.4.3",
"@nestjs/core": "10.4.3",
"@nestjs/platform-fastify": "10.4.3",
"@nestjs/terminus": "10.2.3",
"@nestjs/testing": "10.4.3",
"@tsconfig/node20": "20.1.4",
"@types/eslint__js": "8.42.3",
Expand Down
11 changes: 4 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": ["*"],
"include": ["*.js"],
"compilerOptions": {
"noEmit": true,
"allowJs": true,
Expand Down

0 comments on commit 1fbb5c3

Please sign in to comment.