Skip to content

Commit

Permalink
build: migrate unit tests to GitHub Actions (#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
mantariksh authored May 12, 2021
1 parent bf32595 commit 2b71b24
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 13 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
push:
pull_request:
types: [opened, reopened]

jobs:
install:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci

test-frontend:
needs: install
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test-frontend

test-backend:
needs: install
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Load Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test-backend
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,7 @@ jobs:
name: build
paths: .
- stage: Tests
name: Frontend tests
workspaces:
use: build
script:
- npm run test-frontend
- name: Backend tests
workspaces:
use: build
script:
- npm run test-backend
after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- name: End-to-end tests
name: End-to-end tests
workspaces:
use: build
addons:
Expand Down

0 comments on commit 2b71b24

Please sign in to comment.