Skip to content

Commit

Permalink
fix: migrate to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecilia Woodward committed Jun 30, 2021
1 parent 0d626d8 commit 6132b3a
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 41 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
validate:
name: Validate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- run: npm i
- run: npm start lint
- run: npm start check-types
- run: npm start test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

saucelabs:
name: SauceLabs
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
env:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- uses: saucelabs/sauce-connect-action@v1.1.1
with:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelIdentifier: github-action-tunnel
scVersion: 4.6.4
- run: npm i
- run: npm start test.ci

release:
name: Release
needs: [validate, saucelabs]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- run: npm i
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions karma.ci.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const common = require('./rollup.common.config.js');
module.exports = (config) => {
const browsers = [
'Chrome',
'Firefox',
// Puppeteer support dropped? (causes build to fail)
// Error: Only Nightly release channel is supported in Devtools/Puppeteer for Firefox. Refer to the following issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1606604
// 'Firefox',
'MicrosoftEdge',
'Safari',
'Internet Explorer'
Expand Down Expand Up @@ -71,7 +73,7 @@ module.exports = (config) => {

sauceLabs: {
testName: 'salte-auth/salte-auth',
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
tunnelIdentifier: 'github-action-tunnel',
startConnect: false
},

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"@typescript-eslint/parser": "^4.13.0",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.2.0",
"chai-sinon": "^2.8.1",
"chai-string": "^1.5.0",
"chrome-finder": "^1.0.7",
"coveralls": "^3.1.0",
Expand Down Expand Up @@ -78,6 +77,7 @@
"semantic-release": "^17.0.7",
"serve-handler": "^6.0.0",
"sinon": "^11.1.1",
"sinon-chai": "^3.7.0",
"typedoc": "^0.20.10",
"typescript": "^4.0.2",
"universal-base64url": "^1.0.0",
Expand Down
1 change: 1 addition & 0 deletions rollup.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = function({ minified, es6, tests, coverage, demo, server }) {
name: 'salte.auth',
sourcemap: tests ? 'inline' : true,
exports: 'named',
intro: tests ? 'const global = window;' : null,
banner: deindent`
/**
* ${name} JavaScript Library v${version}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/salte-auth.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import chai from 'chai';
import chaiSinon from 'chai-sinon';
import sinonChai from 'sinon-chai';
import sinon from 'sinon';

import { SalteAuth, Utils, Handler } from '../../src/salte-auth';
import { OpenID } from '../../src/generic';
import { getError } from '../utils/get-error';

const { expect } = chai;
chai.use(chaiSinon);
chai.use(sinonChai);

describe('SalteAuth', () => {
/** @type {SalteAuth} */
Expand Down
4 changes: 2 additions & 2 deletions test/unit/utils/interceptors/fetch.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import chai from 'chai';
import chaiSinon from 'chai-sinon';
import sinonChai from 'sinon-chai';
import sinon from 'sinon';

import { Fetch } from '../../../../src/utils/interceptors/fetch';

const { expect } = chai;
chai.use(chaiSinon);
chai.use(sinonChai);

describe('Fetch', () => {
beforeEach(() => {
Expand Down

0 comments on commit 6132b3a

Please sign in to comment.