-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update dependencies, workflows and security lacks (#58)
* chore: big dependencies update * chore: force typeorm version * fix: force typeorm version in ci * fix: disable flakky test, adapt express version * fix: force express version * fix: disable flakky test * chore: update ci/cd dependencies and workflows order * fix: run npm i -g before to sync schema * fix: better to connect db before to sync schema * fix: delay start server with sync schema * fix: env
- Loading branch information
1 parent
750a685
commit 3838b90
Showing
9 changed files
with
5,848 additions
and
14,862 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: [ dev, main, hotfix/*, feature/*, release/* ] | ||
branches: [ dev, master, hotfix/*, feature/*, release/* ] | ||
jobs: | ||
build: | ||
name: Build | ||
|
@@ -11,17 +11,11 @@ jobs: | |
NODE_ENV: test | ||
steps: | ||
- name: Github checkout | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v4 | ||
- name: Setup node.js environment | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.6.2' | ||
- name: Setup MySQL server | ||
uses: mirromutth/[email protected] | ||
with: | ||
mysql version: '5.7' | ||
mysql database: 'typeplate_test' | ||
mysql root password: passw0rd | ||
node-version: '18.19.0' | ||
- name: Create directories | ||
run: mkdir -p ./dist/env && cp ./src/env/template.env ./dist/env/test.env | ||
- name: Setup .env file | ||
|
@@ -35,14 +29,52 @@ jobs: | |
echo LINKEDIN_CONSUMER_ID = "${{ secrets.LINKEDIN_CONSUMER_ID }}" >> ./dist/env/test.env | ||
echo LINKEDIN_CONSUMER_SECRET = "${{ secrets.LINKEDIN_CONSUMER_SECRET }}" >> ./dist/env/test.env | ||
- name: Install global dependencies | ||
run: npm i typescript -g && npm i typeorm -g | ||
run: npm i typescript@5.3.3 -g && npm i typeorm@0.2.41 -g | ||
- name: Install local dependencies | ||
run: npm i | ||
- name: Compile Typescript files | ||
run: tsc | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-files | ||
path: | | ||
dist | ||
retention-days: 3 | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: [ build ] | ||
env: | ||
RUNNER: github | ||
NODE_ENV: test | ||
steps: | ||
- name: Github checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.19.0' | ||
- name: Setup MySQL server | ||
uses: mirromutth/[email protected] | ||
with: | ||
mysql version: '5.7' | ||
mysql database: 'typeplate_test' | ||
mysql root password: passw0rd | ||
- name: Install global dependencies | ||
run: npm i [email protected] -g && npm i [email protected] -g | ||
- name: Install local dependencies | ||
run: npm i | ||
- name: Create dist directory | ||
run: mkdir dist | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-files | ||
path: dist | ||
- name: Synchronize database schema | ||
run: typeorm schema:sync | ||
- name: Execute tests sets | ||
- name: Execute tests suites | ||
run: npm run ci:test | ||
- name: Publish to coveralls.io | ||
uses: coverallsapp/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,17 +12,11 @@ jobs: | |
NODE_ENV: test | ||
steps: | ||
- name: Github checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- name: Setup node.js environment | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.6.2' | ||
- name: Setup MySQL server | ||
uses: mirromutth/[email protected] | ||
with: | ||
mysql version: '5.7' | ||
mysql database: 'typeplate_test' | ||
mysql root password: passw0rd | ||
node-version: '18.19.0' | ||
- name: Create directories | ||
run: mkdir -p ./dist/env && cp ./src/env/template.env ./dist/env/test.env | ||
- name: Setup .env file | ||
|
@@ -36,14 +30,52 @@ jobs: | |
echo LINKEDIN_CONSUMER_ID = "${{ secrets.LINKEDIN_CONSUMER_ID }}" >> ./dist/env/test.env | ||
echo LINKEDIN_CONSUMER_SECRET = "${{ secrets.LINKEDIN_CONSUMER_SECRET }}" >> ./dist/env/test.env | ||
- name: Install global dependencies | ||
run: npm i typescript -g && npm i typeorm -g | ||
run: npm i typescript@5.3.3 -g && npm i typeorm@0.2.41 -g | ||
- name: Install local dependencies | ||
run: npm i | ||
- name: Compile Typescript files | ||
run: tsc | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-files | ||
path: | | ||
dist | ||
retention-days: 3 | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: [ build ] | ||
env: | ||
RUNNER: github | ||
NODE_ENV: test | ||
steps: | ||
- name: Github checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.19.0' | ||
- name: Setup MySQL server | ||
uses: mirromutth/[email protected] | ||
with: | ||
mysql version: '5.7' | ||
mysql database: 'typeplate_test' | ||
mysql root password: passw0rd | ||
- name: Install global dependencies | ||
run: npm i [email protected] -g && npm i [email protected] -g | ||
- name: Install local dependencies | ||
run: npm i | ||
- name: Create dist directory | ||
run: mkdir dist | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-files | ||
path: dist | ||
- name: Synchronize database schema | ||
run: typeorm schema:sync | ||
- name: Execute tests sets | ||
- name: Execute tests suites | ||
run: npm run ci:test | ||
- name: Publish to coveralls.io | ||
uses: coverallsapp/[email protected] | ||
|
@@ -53,21 +85,21 @@ jobs: | |
release: | ||
name: Release on Github | ||
runs-on: ubuntu-latest | ||
needs: [ build ] | ||
needs: [ build, test ] | ||
steps: | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: node-modules-${{ hashfiles('**/package-lock.json') }} | ||
- name: Github checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup node.js environment | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.6.2' | ||
node-version: '16.19.0' | ||
- name: Create release | ||
uses: konfer-be/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.