-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #448 from loopbackio/actions
ci: add GitHub Actions
- Loading branch information
Showing
4 changed files
with
224 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Continous Integration | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [master] | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
node-version: [12, 14, 16] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: ankane/setup-mysql@v1 | ||
with: | ||
mysql-version: 5.7 | ||
- run: | | ||
sudo mysql -e "CREATE USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED BY '${{ secrets.MYSQL_PASSWORD }}'" | ||
sudo mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '${{ secrets.MYSQL_USER }}'@'localhost'" | ||
sudo mysql -u root -e "ALTER USER '${{ secrets.MYSQL_USER }}'@'localhost' IDENTIFIED WITH mysql_native_password by '${{ secrets.MYSQL_PASSWORD }}'" | ||
sudo mysql -u root -e "FLUSH PRIVILEGES" | ||
- run: npm install | ||
- run: npm test | ||
env: | ||
MYSQL_USER: ${{ secrets.MYSQL_USER }} | ||
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} | ||
CI: true | ||
code-lint: | ||
name: Code Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 14 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- name: Bootstrap project | ||
run: | | ||
npm ci --ignore-scripts | ||
- name: Verify code linting | ||
run: npm run lint | ||
|
||
commit-lint: | ||
name: Commit Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js 14 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
- name: Bootstrap project | ||
run: | | ||
npm ci --ignore-scripts | ||
- name: Verify commit linting | ||
run: npx commitlint --from origin/master --to HEAD --verbose |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright IBM Corp. 2018,2020. All Rights Reserved. | ||
// Node module: loopback4-example-shopping-monorepo | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
extends: [ | ||
'@commitlint/config-conventional', | ||
], | ||
rules: { | ||
'header-max-length': [2, 'always', 100], | ||
'body-leading-blank': [2, 'always'], | ||
'footer-leading-blank': [0, 'always'], | ||
'signed-off-by': [2, 'always', 'Signed-off-by:'], | ||
}, | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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