aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/CI.yml54
1 files changed, 54 insertions, 0 deletions
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
new file mode 100644
index 0000000..7faea9e
--- /dev/null
+++ b/.github/workflows/CI.yml
@@ -0,0 +1,54 @@
+# This is a basic workflow to help you get started with Actions
+
+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 job called "integration"
+ integration:
+ # A strategy that defines different variations of an environment to run each job in.
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ node: [12]
+ # The runners that the job will run on
+ runs-on: ${{ matrix.os }}
+
+ # Steps represent a sequence of tasks that will be executed as part of the job
+ steps:
+ - name: Setup Node.js environment
+ uses: actions/setup-node@v1.4.3
+ with:
+ node-version: ${{ matrix.node }}
+
+ - name: Checkout master branch
+ uses: actions/checkout@v2
+
+ - name: Cache node_modules
+ uses: actions/cache@v2.1.0
+ with:
+ # A list of files, directories, and wildcard patterns to cache and restore
+ path: node_modules
+ # An explicit key for restoring and saving the cache
+ key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/package-lock.json')) }}
+
+ - name: Install dependencies
+ if: steps.cache.outputs.cache-hit != 'true'
+ run: npm install
+
+ - name: Run ESLint
+ run: npm run lint
+
+ - name: Run unit tests
+ run: npm run test:unit
+
+ - name: Code coverage
+ uses: codecov/codecov-action@v1.0.12