Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 434ce10

Browse files
authored
ci: Replace Travis with GitHub Actions (#180)
* ci: Replace Travis with GitHub Actions * ci: Remove travis config * ci: Build before running checks * ci: Update CI badge in README
1 parent bb135e3 commit 434ce10

File tree

4 files changed

+66
-21
lines changed

4 files changed

+66
-21
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This action runs lint checks and tests against the code.
2+
name: Check and Test
3+
4+
# Controls when the action will run.
5+
on:
6+
# Triggers the workflow on pushes to master and pull requests for any branch
7+
push:
8+
branches: [master]
9+
pull_request:
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
check-and-test:
14+
name: Check and Test
15+
# The type of runner that the job will run on
16+
runs-on: ubuntu-20.04
17+
18+
strategy:
19+
matrix:
20+
mongodb_version: [stable, unstable]
21+
22+
env:
23+
MONGODB_VERSION: ${{ matrix.mongodb_version }}
24+
MONGODB_TOPOLOGY: standalone
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29+
- uses: actions/checkout@v2
30+
31+
- name: Setup Node.js environment
32+
uses: actions/[email protected]
33+
with:
34+
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
35+
node-version: 12.4.0
36+
37+
- name: Cache node modules
38+
uses: actions/cache@v2
39+
env:
40+
cache-name: cache-node-modules
41+
with:
42+
# npm cache files are stored in `~/.npm` on Linux/macOS
43+
path: ~/.npm
44+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
45+
restore-keys: |
46+
${{ runner.os }}-build-${{ env.cache-name }}-
47+
${{ runner.os }}-build-
48+
${{ runner.os }}-
49+
50+
- name: Install Dependencies
51+
run: npm ci
52+
53+
- name: Run Tests with Coverage
54+
run: npm run cover
55+
56+
- name: Run Karma Tests
57+
run: npm run test:karma
58+
59+
- name: Create Production Build
60+
run: npm run compile
61+
62+
- name: Run Checks
63+
run: npm run check

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
.editorconfig
44
.nycrc
55
.prettierrc
6-
.travis.yml
76
config/
87
electron/
98
karma.conf.js

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Compass Query Bar [![][travis_img]][travis_url]
1+
# Compass Query Bar [![][workflow_img]][workflow_url]
22

33
> Renders a component for executing MongoDB queries through a GUI.
44
@@ -54,5 +54,5 @@ The fields array must be an array of objects that the ACE editor autocompleter u
5454
[This example](https://github.com/mongodb-js/ace-autocompleter/blob/master/lib/constants/accumulators.js)
5555
for what that array looks like.
5656

57-
[travis_img]: https://travis-ci.org/mongodb-js/compass-query-bar.svg?branch=master
58-
[travis_url]: https://travis-ci.org/mongodb-js/compass-query-bar
57+
[workflow_img]: https://github.com/mongodb-js/compass-query-bar/workflows/Check%20and%20Test/badge.svg?event=push
58+
[workflow_url]: https://github.com/mongodb-js/compass-query-bar/actions?query=workflow%3A%22Check+and+Test%22

0 commit comments

Comments
 (0)