Skip to content

Commit 70d1564

Browse files
authored
fix: support koa server (#9)
* fix: support koa server * ci: add github actions * ci: fix integration test * ci: add secret env for test
1 parent 317500b commit 70d1564

File tree

12 files changed

+232
-206
lines changed

12 files changed

+232
-206
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
env:
12+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
with:
17+
persist-credentials: false
18+
19+
- name: Install Node.js and npm
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: 14.x
23+
registry-url: https://registry.npmjs.org
24+
25+
- name: Retrieve dependencies from cache
26+
id: cacheNpm
27+
uses: actions/cache@v2
28+
with:
29+
path: |
30+
~/.npm
31+
node_modules
32+
key: npm-v14-${{ runner.os }}-refs/heads/master-${{ hashFiles('package.json') }}
33+
restore-keys: npm-v14-${{ runner.os }}-refs/heads/master-
34+
35+
- name: Install dependencies
36+
if: steps.cacheNpm.outputs.cache-hit != 'true'
37+
run: |
38+
npm update --no-save
39+
npm update --save-dev --no-save
40+
- name: Releasing
41+
run: |
42+
npm run release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
45+
GIT_AUTHOR_NAME: slsplus
46+
GIT_AUTHOR_EMAIL: yuga.sun.bj@gmail.com
47+
GIT_COMMITTER_NAME: slsplus
48+
GIT_COMMITTER_EMAIL: yuga.sun.bj@gmail.com

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
test:
9+
name: Test
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
# Ensure connection with 'master' branch
16+
fetch-depth: 2
17+
18+
- name: Install Node.js and npm
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
registry-url: https://registry.npmjs.org
23+
24+
- name: Retrieve dependencies from cache
25+
id: cacheNpm
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.npm
30+
node_modules
31+
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
32+
restore-keys: |
33+
npm-v14-${{ runner.os }}-${{ github.ref }}-
34+
npm-v14-${{ runner.os }}-refs/heads/master-
35+
36+
- name: Install dependencies
37+
if: steps.cacheNpm.outputs.cache-hit != 'true'
38+
run: |
39+
npm update --no-save
40+
npm update --save-dev --no-save
41+
- name: Running integration tests
42+
run: npm run test
43+
env:
44+
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
45+
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}

.github/workflows/validate.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
lintAndFormatting:
9+
name: Lint & Formatting
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
# Ensure connection with 'master' branch
16+
fetch-depth: 2
17+
18+
- name: Install Node.js and npm
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14.x
22+
registry-url: https://registry.npmjs.org
23+
24+
- name: Retrieve dependencies from cache
25+
id: cacheNpm
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
~/.npm
30+
node_modules
31+
key: npm-v14-${{ runner.os }}-${{ github.ref }}-${{ hashFiles('package.json') }}
32+
restore-keys: |
33+
npm-v14-${{ runner.os }}-${{ github.ref }}-
34+
npm-v14-${{ runner.os }}-refs/heads/master-
35+
36+
- name: Install dependencies
37+
if: steps.cacheNpm.outputs.cache-hit != 'true'
38+
run: |
39+
npm update --no-save
40+
npm update --save-dev --no-save
41+
42+
- name: Validate Formatting
43+
run: npm run prettier:fix
44+
- name: Validate Lint rules
45+
run: npm run lint:fix

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.en.md

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)