-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(github): enable github actions (#277)
- Loading branch information
Showing
6 changed files
with
130 additions
and
30 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,31 @@ | ||
name: Health Check | ||
|
||
on: | ||
schedule: | ||
# At minute 0 past hour 0800 and 2000. | ||
- cron: '0 8,20 * * *' | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '10.x', '12.x', '14.x', '16.x' ] | ||
name: Node ${{ matrix.node }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
git remote set-branches --add origin main | ||
git fetch | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install Dependencies | ||
run: npm ci | ||
env: | ||
NODE_ENV: development | ||
- name: Run Test Script | ||
run: npm run test | ||
env: | ||
NODE_ENV: production |
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,37 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
if: "! contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- run: echo "${{ github.event.head_commit.message }}" | ||
release: | ||
needs: prepare | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Release | ||
env: | ||
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | ||
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | ||
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | ||
GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | ||
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |
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,43 @@ | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '10.x','12.x', '14.x', '16.x' ] | ||
name: Node ${{ matrix.node }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
git remote set-branches --add origin main | ||
git fetch | ||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- name: Install Dependencies | ||
run: npm ci | ||
env: | ||
NODE_ENV: development | ||
- name: Unit Tests | ||
run: npm run test | ||
env: | ||
NODE_ENV: production | ||
- name: Lockfile Lint Test | ||
run: npm run test:lockfile | ||
env: | ||
NODE_ENV: production | ||
- name: Git History Test | ||
run: npm run test:git-history | ||
env: | ||
NODE_ENV: production | ||
- name: Lint | ||
run: npm run lint | ||
env: | ||
NODE_ENV: production |
This file was deleted.
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
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