Skip to content

Commit

Permalink
[web] Add GitHub actions for building and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Feb 10, 2022
1 parent e50c45a commit 8db9936
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

defaults:
run:
working-directory: ./web

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'web/package-lock.json'

- name: Install dependencies
run: npm install

# - name: Build the application
# run: npm run build --if-present

- name: Run the tests and generate coverage report
run: npm test \"src/**/*.test.js\" -- --coverage

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: ./web
path-to-lcov: ./web/coverage/lcov.info
flag-name: Unit
2 changes: 1 addition & 1 deletion web/src/lib/InstallerClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class InstallerClient {
headers: { Authorization: `Basic ${auth}`, "X-Superuser": "any" }
}).then(resp => {
if (resp.status == 200) {
resolve();
resolve(true);
} else {
reject(resp.statusText);
}
Expand Down

0 comments on commit 8db9936

Please sign in to comment.