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

Feature/ci #972

Merged
merged 5 commits into from
Nov 5, 2021
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
27 changes: 22 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
fail-fast: false
matrix:
node-version: [10, 12, 14]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 16 is now LTS, maybe include that as well? Not sure what the policy is from the main repo on supported Node versions

name: Postgres (Node ${{ matrix.node-version }})
sequelize-version: [5, latest]
name: Postgres (Node ${{ matrix.node-version }}, Sequelize ${{ matrix.sequelize-version }})
runs-on: ubuntu-latest
env:
DIALECT: postgres
Expand All @@ -19,7 +20,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm install sequelize@latest
- run: npm install sequelize@${{ matrix.sequelize-version }}
- run: npm run build
- run: docker-compose up -d ${DIALECT}
- run: docker run --link ${DIALECT}:db -e CHECK_PORT=${SEQ_PORT::-1} -e CHECK_HOST=db --net cli_default giorgos/takis
Expand All @@ -29,7 +30,8 @@ jobs:
fail-fast: false
matrix:
node-version: [10, 12, 14]
name: MySQL (Node ${{ matrix.node-version }})
sequelize-version: [5, latest]
name: MySQL (Node ${{ matrix.node-version }}, Sequelize ${{ matrix.sequelize-version }})
runs-on: ubuntu-latest
env:
DIALECT: mysql
Expand All @@ -40,7 +42,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm install sequelize@latest
- run: npm install sequelize@${{ matrix.sequelize-version }}
- run: npm run build
- run: docker-compose up -d ${DIALECT}
- run: docker run --link ${DIALECT}:db -e CHECK_PORT=${SEQ_PORT::-1} -e CHECK_HOST=db --net cli_default giorgos/takis
Expand All @@ -63,4 +65,19 @@ jobs:
- run: npm install
- run: npm install sequelize@${{ matrix.sequelize-version }}
- run: npm run build
- run: npm run test
- run: npm run test
release:
name: Release
runs-on: ubuntu-latest
needs: [test-sqlite, test-postgres, test-mysql]
if: github.event_name == 'push' && github.ref == 'refs/heads/release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm install
- run: npx semantic-release
32 changes: 32 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
"@babel/core": "^7.10.2",
"@babel/preset-env": "^7.10.2",
"@babel/register": "^7.10.1",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-angular": "^14.1.0",
"bluebird": "^3.7.2",
"eslint": "^7.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"expect.js": "^0.3.1",
"gulp": "^4.0.0",
"husky": "^7.0.4",
"mocha": "^8.0.0",
"mysql2": "latest",
"pg": "latest",
Expand Down Expand Up @@ -87,5 +90,34 @@
"homepage": "https://github.com/sequelize/cli",
"engines": {
"node": ">=10.0.0"
},
"commitlint": {
"extends": [
"@commitlint/config-angular"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any specific reason why you use this configuration?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a copy from sequelize/sequelize

],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"meta"
]
]
}
},
"husky": {
"hooks": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a pre-commit hook that runs the linter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And possibly with lint-staged to make it quicker

"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}