chore: use github actions for ts rather than travis

This commit is contained in:
Connor Peet 2020-06-15 21:51:55 -07:00
Родитель 92f7e69ef6
Коммит 5c638a6867
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: CF8FD2EA0DBC61BD
6 изменённых файлов: 2963 добавлений и 196 удалений

23
.github/workflows/ci.yml поставляемый Normal file
Просмотреть файл

@ -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

6
.mocharc.js Normal file
Просмотреть файл

@ -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'
};

Просмотреть файл

@ -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

3
.vscode/settings.json поставляемый
Просмотреть файл

@ -6,5 +6,8 @@
"**/lib": true,
"**/.nyc_output": true,
"**/docs": true,
},
"files.exclude": {
"**/.nyc_output": true,
}
}

3091
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -5,8 +5,8 @@
"main": "lib/src/index.js",
"typings": "lib/src/index.d.ts",
"scripts": {
"test": "npm-run-all --parallel test:lint test:unit",
"test:unit": "mocha --require source-map-support/register --require ./lib/test/_setup.js \"lib/test/**/*.test.js\" --timeout 10000 --exit",
"test": "concurrently npm:test:lint npm:test:unit",
"test:unit": "mocha",
"test:cover": "nyc mocha",
"test:lint": "eslint \"src/**/*.ts\"",
"watch": "tsc --watch",
@ -21,15 +21,6 @@
"url": "git+https://github.com/microsoft/etcd3.git"
},
"nyc": {
"include": [
"src/**/*.ts"
],
"extension": [
".ts"
],
"require": [
"ts-node/register"
],
"reporter": [
"text-summary",
"html"
@ -64,13 +55,13 @@
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"change-case": "^4.1.1",
"concurrently": "^5.2.0",
"eslint": "^7.2.0",
"eslint-plugin-header": "^3.0.0",
"lodash": "^4.17.15",
"mocha": "^8.0.1",
"ncp": "^2.0.0",
"node-fetch": "^2.6.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"protobufjs": "^6.9.0",