Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI #1870

Closed
wants to merge 17 commits into from
Closed

CI #1870

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/continuous-integration.yml
@@ -0,0 +1,123 @@
name: Continuous Integration

on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- 'greenkeeper/**'

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Cache npm dependencies
uses: actions/cache@v1
with:
key: npm-${{ hashFiles('package-lock.json') }}
path: ~/.npm
restore-keys: |
npm-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --prefer-offline --progress=false
- name: Format
run: npm run format
lint-javascript:
name: Lint JavaScript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Cache npm dependencies
uses: actions/cache@v1
with:
key: npm-${{ hashFiles('package-lock.json') }}
path: ~/.npm
restore-keys: |
npm-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --prefer-offline --progress=false
- name: Lint
run: npm run lint:js
lint-typescript:
name: Lint TypeScript declaration files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Cache npm dependencies
uses: actions/cache@v1
with:
key: npm-${{ hashFiles('package-lock.json') }}
path: ~/.npm
restore-keys: |
npm-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --prefer-offline --progress=false
- name: Lint
run: |
npm run lint:ts
test:
name: Test
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm dependencies
uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: |
npm-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
npm-${{ runner.os }}-${{ matrix.node-version }}-
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --prefer-offline --progress=false
# The following conditional can be removed once tests are fully migrated
# to Mocha. Alternatively a grep command used to select correct files can
# be refactored to work on Windows. Ideally all tests should be run across
# all platforms.
- if: runner.os != 'Windows'
name: Test
run: npm run test
- if: runner.os == 'Windows'
name: Test
run: npm run test:tap
strategy:
fail-fast: false
matrix:
node-version: [8, 10, 12, 13]
os: [macos-latest, ubuntu-latest, windows-latest]
7 changes: 4 additions & 3 deletions .gitignore
@@ -1,6 +1,7 @@
.cache
.nyc_output
.vscode
coverage
node_modules
npm-debug.log
coverage
.nyc_output/
tests/browserify-public/browserify-bundle.js
.vscode/
19 changes: 1 addition & 18 deletions .travis.yml
Expand Up @@ -12,8 +12,6 @@ branches:
- /^\d+\.x$/ # semantic-release maintenance releases

stages:
- lint
- test
- name: release
if: branch =~ /^(\d+\.x|master|next|beta)$/ AND type IN (push)
- name: update-prettier
Expand All @@ -25,24 +23,9 @@ jobs:
node_js: lts/*
script:
- git checkout $TRAVIS_BRANCH
- npm run prettier
- npm run format:fix
# commit changes and push back to branch on GitHub. If there are no changes then exit without error
- 'git commit -a -m "style: prettier" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
- stage: lint
node_js: lts/*
env: linting
# Show prettier errors, even if lint fails.
script: run-s --silent --continue-on-error lint prettier:check dtslint
- stage: test
node_js: 12
# Avoid running lint and prettier again.
script: npm run --silent unit && npm run mocha
- node_js: 10
# Avoid running lint and prettier again.
script: npm run --silent unit && npm run mocha
- node_js: 8
# Avoid running lint and prettier again.
script: npm run --silent unit && npm run mocha
- stage: release
node_js: lts/*
env: semantic-release
Expand Down