Skip to content

Commit 0fa3595

Browse files
authored
Merge pull request #386 from qiniu/migrate/github-action
切换到 Github Action
2 parents bd17e26 + ca1a4d3 commit 0fa3595

File tree

5 files changed

+41
-34
lines changed

5 files changed

+41
-34
lines changed

.github/workflows/ci-test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: NodeJS CI with NPM
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '**.md'
7+
8+
jobs:
9+
build:
10+
strategy:
11+
fail-fast: false
12+
max-parallel: 1
13+
matrix:
14+
node_version: ['6', '8', '10', '12', '14', '16']
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Setup NodeJS
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: ${{ matrix.node_version }}
23+
- name: Setup dependencies
24+
run: |
25+
npm install
26+
npm install -g [email protected]
27+
npm install -g istanbul
28+
- name: Run cases
29+
run: |
30+
npm test
31+
istanbul cover ./node_modules/mocha/bin/_mocha --reporter test -- -R spec
32+
codecov
33+
env:
34+
QINIU_ACCESS_KEY: ${{ secrets.QINIU_ACCESS_KEY }}
35+
QINIU_SECRET_KEY: ${{ secrets.QINIU_SECRET_KEY }}
36+
QINIU_TEST_BUCKET: ${{ secrets.QINIU_TEST_BUCKET }}
37+
QINIU_TEST_DOMAIN: ${{ secrets.QINIU_TEST_DOMAIN }}

.travis.yml

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

qiniu/rtc/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const headers = {
55
'Content-Type': 'application/json'
66
};
77

8-
function get (credentials, options, fn) {
8+
function get(credentials, options, fn) {
99
options.headers.Authorization = credentials.generateAccessToken(options, null);
1010

1111
var req = http.request(options, function (res) {
@@ -39,7 +39,7 @@ function get (credentials, options, fn) {
3939
req.end();
4040
}
4141

42-
function post (credentials, options, data, fn) {
42+
function post(credentials, options, data, fn) {
4343
var dataString = JSON.stringify(data);
4444

4545
options.headers.Authorization = credentials.generateAccessToken(options, dataString);

test-env.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@ export QINIU_ACCESS_KEY="<ACCESS KEY>"
22
export QINIU_SECRET_KEY="<SECRET KEY>"
33
export QINIU_TEST_BUCKET="<BUCKET NAME>"
44
export QINIU_TEST_DOMAIN="<BUCKEY DOMAIN>"
5-
6-
export QINIU_PILI_ACCESS_KEY="<PILI ACCESS KEY>"
7-
export QINIU_PILI_SECRET_KEY="<PILI SECRET KEY>"

test/rtc.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const console = require('console');
66

77
// eslint-disable-next-line no-undef
88
before(function (done) {
9-
if (!process.env.QINIU_PILI_ACCESS_KEY || !process.env.QINIU_PILI_SECRET_KEY) {
9+
if (!process.env.QINIU_ACCESS_KEY || !process.env.QINIU_SECRET_KEY) {
1010
console.log('should run command `source test-env.sh` first\n');
1111
process.exit(0);
1212
}
@@ -21,7 +21,7 @@ describe('test rtc credentials', function () {
2121
var credentials = new qiniu.Credentials(accessKey, secretKey);
2222
var appId = null;
2323
var appData = {
24-
hub: 'sdk-live',
24+
hub: 'hailong',
2525
title: 'testtitle',
2626
maxUsers: 10,
2727
noAutoKickUser: true

0 commit comments

Comments
 (0)