зеркало из https://github.com/microsoft/etcd3.git
chore: use github actions for ts rather than travis
This commit is contained in:
Родитель
92f7e69ef6
Коммит
5c638a6867
|
@ -0,0 +1,23 @@
|
||||||
|
name: Run Tests
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
node-version: [^10, ^12, ^14]
|
||||||
|
etcd-version: [v3.1.5, v3.2.4, v3.3.9]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- run: curl -L https://github.com/coreos/etcd/releases/download/${{ matrix.etcd-version }}/etcd-${{ matrix.etcd-version }}-linux-amd64.tar.gz -o /tmp/etcd-${{ matrix.etcd-version }}-linux-amd64.tar.gz
|
||||||
|
- run: mkdir -p /tmp/etcd
|
||||||
|
- run: tar xzvf /tmp/etcd-${{ matrix.etcd-version }}-linux-amd64.tar.gz -C /tmp/etcd --strip-components=1
|
||||||
|
- run: /tmp/etcd/etcd --advertise-client-urls https://127.0.0.1:2379 --listen-client-urls https://127.0.0.1:2379 --cert-file ${{ github.workspace }}/src/test/certs/certs/etcd0.localhost.crt --key-file ${{ github.workspace }}/src/test/certs/private/etcd0.localhost.key > /dev/null &
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run build:ts
|
||||||
|
- run: npm test
|
|
@ -0,0 +1,6 @@
|
||||||
|
module.exports = {
|
||||||
|
require: ['source-map-support/register', './lib/test/_setup.js'],
|
||||||
|
timeout: 10 * 1000,
|
||||||
|
exit: true,
|
||||||
|
spec: 'lib/test/**/*.test.js'
|
||||||
|
};
|
19
.travis.yml
19
.travis.yml
|
@ -1,19 +0,0 @@
|
||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- 8
|
|
||||||
- 10
|
|
||||||
- 12
|
|
||||||
env:
|
|
||||||
- ETCD_VER=v3.1.5
|
|
||||||
- ETCD_VER=v3.2.4
|
|
||||||
- ETCD_VER=v3.3.9
|
|
||||||
before_install:
|
|
||||||
- curl -L https://github.com/coreos/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz
|
|
||||||
- mkdir -p /tmp/etcd
|
|
||||||
- tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd --strip-components=1
|
|
||||||
- /tmp/etcd/etcd
|
|
||||||
--advertise-client-urls https://127.0.0.1:2379
|
|
||||||
--listen-client-urls https://127.0.0.1:2379
|
|
||||||
--cert-file ${TRAVIS_BUILD_DIR}/test/certs/certs/etcd0.localhost.crt
|
|
||||||
--key-file ${TRAVIS_BUILD_DIR}/test/certs/private/etcd0.localhost.key > /dev/null &
|
|
||||||
- npm i -g npm
|
|
|
@ -6,5 +6,8 @@
|
||||||
"**/lib": true,
|
"**/lib": true,
|
||||||
"**/.nyc_output": true,
|
"**/.nyc_output": true,
|
||||||
"**/docs": true,
|
"**/docs": true,
|
||||||
|
},
|
||||||
|
"files.exclude": {
|
||||||
|
"**/.nyc_output": true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
15
package.json
15
package.json
|
@ -5,8 +5,8 @@
|
||||||
"main": "lib/src/index.js",
|
"main": "lib/src/index.js",
|
||||||
"typings": "lib/src/index.d.ts",
|
"typings": "lib/src/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm-run-all --parallel test:lint test:unit",
|
"test": "concurrently npm:test:lint npm:test:unit",
|
||||||
"test:unit": "mocha --require source-map-support/register --require ./lib/test/_setup.js \"lib/test/**/*.test.js\" --timeout 10000 --exit",
|
"test:unit": "mocha",
|
||||||
"test:cover": "nyc mocha",
|
"test:cover": "nyc mocha",
|
||||||
"test:lint": "eslint \"src/**/*.ts\"",
|
"test:lint": "eslint \"src/**/*.ts\"",
|
||||||
"watch": "tsc --watch",
|
"watch": "tsc --watch",
|
||||||
|
@ -21,15 +21,6 @@
|
||||||
"url": "git+https://github.com/microsoft/etcd3.git"
|
"url": "git+https://github.com/microsoft/etcd3.git"
|
||||||
},
|
},
|
||||||
"nyc": {
|
"nyc": {
|
||||||
"include": [
|
|
||||||
"src/**/*.ts"
|
|
||||||
],
|
|
||||||
"extension": [
|
|
||||||
".ts"
|
|
||||||
],
|
|
||||||
"require": [
|
|
||||||
"ts-node/register"
|
|
||||||
],
|
|
||||||
"reporter": [
|
"reporter": [
|
||||||
"text-summary",
|
"text-summary",
|
||||||
"html"
|
"html"
|
||||||
|
@ -64,13 +55,13 @@
|
||||||
"chai-as-promised": "^7.1.1",
|
"chai-as-promised": "^7.1.1",
|
||||||
"chai-subset": "^1.6.0",
|
"chai-subset": "^1.6.0",
|
||||||
"change-case": "^4.1.1",
|
"change-case": "^4.1.1",
|
||||||
|
"concurrently": "^5.2.0",
|
||||||
"eslint": "^7.2.0",
|
"eslint": "^7.2.0",
|
||||||
"eslint-plugin-header": "^3.0.0",
|
"eslint-plugin-header": "^3.0.0",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"mocha": "^8.0.1",
|
"mocha": "^8.0.1",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"npm-run-all": "^4.1.5",
|
|
||||||
"nyc": "^15.1.0",
|
"nyc": "^15.1.0",
|
||||||
"prettier": "^2.0.5",
|
"prettier": "^2.0.5",
|
||||||
"protobufjs": "^6.9.0",
|
"protobufjs": "^6.9.0",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче