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

Commit 198b6bf

Browse files
authored
ci: Move CI to GitHub Actions (#274)
* ci: Move CI to GitHub Actions * chore: Remove travis config * chore: Update CI badge * ci: Use latest Ubuntu and remove packages installation
1 parent 3b89d89 commit 198b6bf

File tree

4 files changed

+72
-25
lines changed

4 files changed

+72
-25
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
check-and-test:
17+
name: Check and Test
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-20.04
20+
21+
strategy:
22+
matrix:
23+
mongodb_version: [stable, unstable]
24+
25+
env:
26+
MONGODB_VERSION: ${{ matrix.mongodb_version }}
27+
MONGODB_TOPOLOGY: standalone
28+
29+
# Steps represent a sequence of tasks that will be executed as part of the job
30+
steps:
31+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
32+
- uses: actions/checkout@v2
33+
34+
- name: Setup Node.js environment
35+
uses: actions/setup-node@v2.1.2
36+
with:
37+
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0
38+
node-version: 12.4.0
39+
40+
- name: Cache node modules
41+
uses: actions/cache@v2
42+
env:
43+
cache-name: cache-node-modules
44+
with:
45+
# npm cache files are stored in `~/.npm` on Linux/macOS
46+
path: ~/.npm
47+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
48+
restore-keys: |
49+
${{ runner.os }}-build-${{ env.cache-name }}-
50+
${{ runner.os }}-build-
51+
${{ runner.os }}-
52+
53+
- name: Install Dependencies
54+
run: npm install
55+
56+
- name: Run Checks
57+
run: npm run check
58+
59+
- name: Run Tests
60+
run: npm run test
61+
62+
- name: Maybe Clean-Up
63+
# Apparently sometimes mongodb-runner that is used in tests can leave
64+
# mongo processes still running after tests are done. This step should
65+
# ensure that no mongo process is running anymore
66+
run: |
67+
echo "Terminating rogue mongo servers ..."
68+
killall -v -KILL mongod || true
69+
killall -v -KILL mongos || true

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
.eslintrc
2-
.travis.yml
32
test/
43
.github/

.travis.yml

Lines changed: 0 additions & 21 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-
# mongodb-data-service [![][travis_img]][travis_url] [![][npm_img]][npm_url] [![][dependabot_img]][dependabot_url]
1+
# mongodb-data-service [![][workflow_img]][workflow_url] [![][npm_img]][npm_url] [![][dependabot_img]][dependabot_url]
22

33
> MongoDB Data Service: an API on top of (currently) the [MongoDB Node Driver][driver] and (some day) [mongodb-scope-client][scope-client].
44
@@ -154,8 +154,8 @@ All tests in an electron renderer process thanks to [electron-mocha](https://npm
154154

155155
Apache 2.0
156156

157-
[travis_img]: https://img.shields.io/travis/mongodb-js/data-service.svg?style=flat-square
158-
[travis_url]: https://travis-ci.org/mongodb-js/data-service
157+
[workflow_img]: https://github.com/mongodb-js/data-service/workflows/Check%20and%20Test/badge.svg?event=push
158+
[workflow_url]: https://github.com/mongodb-js/data-service/actions?query=workflow%3A%22Check+and+Test%22
159159
[npm_img]: https://img.shields.io/npm/v/mongodb-data-service.svg?style=flat-square
160160
[npm_url]: https://www.npmjs.org/package/mongodb-data-service
161161
[scope-client]: https://github.com/mongodb-js/scope-client

0 commit comments

Comments
 (0)