Skip to content

Commit

Permalink
Configure CI workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-lee committed Apr 7, 2023
1 parent 1760b17 commit 2fd6eff
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 386 deletions.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**What does this do?**
[Description of what this PR does.]

**Why are we doing this? (with JIRA link)**
[Quick blurb about why the code is needed and a JIRA link. Do these changes meet the business requirements of the story?]

**How should this be tested? Do these changes have associated tests?**
[Description of any tests that need to be performed once merged.]

**Dependencies for merging? Releasing to production?**
[Description of any watchouts, dependencies, or issues we should be aware of.]

**Has the application documentation been updated for these changes?**

**Did someone actually run this code to verify it works?**
12 changes: 12 additions & 0 deletions .github/workflows/ci-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Continuous integration

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
check:
name: Check code
uses: collectionspace/.github/.github/workflows/check-js.yml@main
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# cspace-client

[![npm package](https://img.shields.io/npm/v/cspace-client.svg)](https://www.npmjs.com/package/cspace-client)
[![Build Status](https://travis-ci.org/collectionspace/cspace-client.js.svg?branch=master)](https://travis-ci.org/collectionspace/cspace-client.js)
[![Coverage Status](https://coveralls.io/repos/github/collectionspace/cspace-client.js/badge.svg?branch=master)](https://coveralls.io/github/collectionspace/cspace-client.js?branch=master)
[![continuous integration](https://github.com/collectionspace/cspace-client.js/actions/workflows/ci-js.yml/badge.svg?branch=master&event=push)](https://github.com/collectionspace/cspace-client.js/actions/workflows/ci-js.yml)

A CollectionSpace client, built on the [cspace-api](https://github.com/collectionspace/cspace-api.js) library.

Expand Down
27 changes: 24 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,30 @@ const getTestFiles = (config) => {
};

module.exports = function karma(config) {
// This is a local run.
const localBrowsers = ['Chrome'];
const githubBrowsers = ['Chrome', 'Firefox'];

console.log('Running locally.');
let browsers;

const browsers = localBrowsers;
if (process.env.GITHUB_ACTIONS) {
// This is a CI run on GitHub.

console.log('Running on GitHub.');

browsers = githubBrowsers;
} else {
// This is a local run.

console.log('Running locally.');

const localBrowsersEnv = process.env.KARMA_BROWSERS;

browsers = localBrowsersEnv ? localBrowsersEnv.split(',') : localBrowsers;
}

config.set({
browsers,
concurrency: 1,
files: getTestFiles(config),

frameworks: [
Expand All @@ -47,6 +62,12 @@ module.exports = function karma(config) {
'coverage',
],

client: {
mocha: {
timeout: 4000,
},
},

autoWatch: true,
singleRun: config.singleRun === 'true',

Expand Down

0 comments on commit 2fd6eff

Please sign in to comment.