Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor pipeline #2

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
":pinAllExceptPeerDependencies",
":disableRateLimiting"
],
"schedule": [
"at any time"
],
"packageRules": [
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["patch", "minor"],
"groupName": "All non-major dependencies",
"groupSlug": "all-non-major-dependencies",
"automerge": true,
"labels": ["dependencies"]
},
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["major"],
"groupName": "All major dependencies",
"groupSlug": "all-major-dependencies",
"labels": ["dependencies", "breaking"]
}
]
}
44 changes: 0 additions & 44 deletions .github/workflows/build.yml

This file was deleted.

147 changes: 147 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: CI

on:
pull_request:
branches:
- '*'
push:
branches:
- main
- develop

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 6

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: package.json

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: dist
key: ${{ runner.os }}-build-${{ github.sha }}

format:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 6

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: package.json

- name: Install dependencies
run: pnpm install

- name: Check Format
run: pnpm format:check

lint:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 6

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: package.json

- name: Install dependencies
run: pnpm install

- name: Check Linter
run: pnpm lint

test:
runs-on: ubuntu-latest
needs: [build, format, lint]

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/[email protected]
with:
version: 6

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: package.json

- name: Install dependencies
run: pnpm install

- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: dist
key: ${{ runner.os }}-build-${{ github.sha }}

- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: pnpm build

- name: Check Tests
run: pnpm test:js:ci:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ lerna-debug.log*

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/tasks.json
!.vscode/extensions.json

# ENV
Expand All @@ -43,3 +42,5 @@ reports/
ormconfig.json

/config/
/data
pnpm-lock.yaml
6 changes: 4 additions & 2 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"collectCoverageFrom": ["**/*.ts"],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
"/fixtures/",
"/model/"
],
"coverageThreshold": {
"global": {
Expand All @@ -30,7 +31,8 @@
"collectCoverageFrom": ["**/*.ts"],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
"/fixtures/",
"/model/"
],
"coverageThreshold": {
"global": {
Expand Down
12 changes: 7 additions & 5 deletions jest.js.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"collectCoverageFrom": ["**/*.js"],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
"/fixtures/",
"/model/"
],
"coverageThreshold": {
"global": {
Expand All @@ -19,15 +20,16 @@
"resolver": "<rootDir>/../jest-resolver.js",
"rootDir": "dist",
"testEnvironment": "node",
"testMatch": ["<rootDir>/**/*.spec.js"],
"testPathIgnorePatterns": ["/node_modules", ".int.spec.js"]
"testMatch": ["<rootDir>/**/*.int.spec.js"],
"testPathIgnorePatterns": ["/node_modules"]
},
{
"displayName": "Unit",
"collectCoverageFrom": ["**/*.js"],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
"/fixtures/",
"/model/"
],
"coverageThreshold": {
"global": {
Expand All @@ -42,7 +44,7 @@
"rootDir": "dist",
"testEnvironment": "node",
"testMatch": ["<rootDir>/**/*.spec.js"],
"testPathIgnorePatterns": ["/node_modules"]
"testPathIgnorePatterns": ["/node_modules", ".int.spec.js"]
}
]
}
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"build:git:hook": "tsc -p tsconfig.build.gitHook.json",
"format": "prettier --write \"src/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\"",
"linter": "eslint 'src/**/*.ts'",
"linter:fix": "eslint --fix 'src/**/*.ts'",
"lint": "eslint 'src/**/*.ts'",
"lint:fix": "eslint --fix 'src/**/*.ts'",
"start:dev": "tsc-watch -p tsconfig.build.json --onSuccess \"node --inspect=0.0.0.0:9229 dist/main.js\"",
"start:prod": "node dist/main.js",
"test": "jest",
"test:debug": "node --inspect-brk node_modules/jest/bin/jest.js --runInBand",
"test:coverage": "npm test -- --coverage",
"test:develop": "jest --changedSince=origin/develop",
"test:previous": "jest --changedSince=HEAD~1",
Expand All @@ -22,11 +23,6 @@
"test:js": "npm test -- --config=jest.js.config.json",
"test:unit": "jest --selectProjects Unit",
"test:unit:js": "npm run test:js -- --selectProjects Unit",
"typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js",
"migration:apply": "npm run typeorm -- migration:run",
"migration:create": "npm run typeorm -- migration:create -n",
"migration:generate": "npm run typeorm -- migration:generate -n",
"migration:revert": "npm run typeorm -- migration:revert",
"prepare": "husky install"
},
"author": "",
Expand Down