From e30a8a0b4363b5bfe6fea17be6b17e0b5034e851 Mon Sep 17 00:00:00 2001 From: Yevhen Vydolob Date: Wed, 12 Aug 2020 16:38:05 +0300 Subject: [PATCH] Add GH Actions workflow to build PR (#299) * #295 add GH Actions workflow to build PR Signed-off-by: Yevhen Vydolob * use 'yarn', add Coveralls step Signed-off-by: Yevhen Vydolob * Fix Coveralls Signed-off-by: Yevhen Vydolob * Fix coveralls again Signed-off-by: Yevhen Vydolob * Set ubuntu-latest, use proper script to run coveralls Signed-off-by: Yevhen Vydolob * Configure prettier to use always 'lf' Signed-off-by: Yevhen Vydolob * Set 'endOfLine' to auto Signed-off-by: Yevhen Vydolob --- .github/workflows/CI.yaml | 52 +++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + .prettierrc.json | 4 ++- .travis.yml | 2 -- package.json | 6 +++-- 5 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/CI.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 00000000..97d1eb92 --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,52 @@ +# This is a basic workflow + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [master] + pull_request: + branches: [master] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Set up Node + - name: Use Node 12 + uses: actions/setup-node@v1 + with: + node-version: 12 + + # Run install dependencies + - name: Install dependencies + run: yarn + + # Build extension + - name: Run build + run: yarn build + + # Run tests + - name: Run Test + uses: GabrielBB/xvfb-action@v1.0 + with: + run: yarn coveralls + + # Run Coveralls + - name: Coveralls + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index d29ef61f..5e1b99a6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ npm-debug.log out/server .DS_Store yarn-error.log +coverage diff --git a/.prettierrc.json b/.prettierrc.json index 86f0cb75..86d8c1e5 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,6 +1,8 @@ { + "$schema": "http://json.schemastore.org/prettierrc", "arrowParens": "always", "printWidth": 130, "singleQuote": true, - "trailingComma": "es5" + "trailingComma": "es5", + "endOfLine": "auto" } diff --git a/.travis.yml b/.travis.yml index 824b6a94..10b7850e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,6 @@ before_install: install: - yarn install - yarn run build -after_script: - - yarn run coveralls deploy: provider: npm email: gorkem.ercan@gmail.com diff --git a/package.json b/package.json index bcd0da40..9932aed5 100755 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "watch": "tsc --watch -p .", "test": "mocha --require ts-node/register --ui tdd ./test/*.test.ts", "coverage": "nyc mocha --require ts-node/register --require source-map-support/register --recursive --ui tdd ./test/*.test.ts", - "coveralls": "nyc yarn test && nyc report --reporter=text-lcov | coveralls", + "coveralls": "nyc --reporter=lcov --reporter=text mocha --require ts-node/register --require source-map-support/register --recursive --ui tdd ./test/*.test.ts", "lint": "eslint -c .eslintrc.js --ext .ts src test", "prettier-fix": "yarn prettier --write .", "build": "yarn clean && yarn lint && yarn compile" @@ -79,7 +79,9 @@ "exclude": [ "**/*.d.ts", "test/", - "out" + "out", + "coverage/", + ".eslintrc.js" ], "all": true }