Skip to content

Commit

Permalink
Replace Travis CI with GitHub Actions (#16)
Browse files Browse the repository at this point in the history
* Update badges

* Move renovate config into github folder

* Add github actions workflow

* Delete travis config

* Update license

* Fix flow error with jest config

* Fix flow type errors

* Remove redundant __SDK_HOST__ config

Co-authored-by: Greg Jopa <534034+gregjopa@users.noreply.github.com>
  • Loading branch information
nbierdeman and gregjopa committed Dec 17, 2020
1 parent f5a51a6 commit e78a77c
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 35 deletions.
File renamed without changes.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build
on:
# run on push but only for the master branch
push:
branches:
- master
# run for every pull request
pull_request: {}
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10.13, 12, 14]
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v2

- name: ⎔ Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: ▶️ Run flow-typed script
run: npm run flow-typed

- name: ▶️ Run build script
run: npm run build

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v1
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

15 changes: 2 additions & 13 deletions LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
https://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

Expand Down Expand Up @@ -175,24 +175,13 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016 PayPal

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
PayPal Common Components
------------------------

[![npm version](https://img.shields.io/npm/v/@paypal/common-components.svg?style=flat-square)](https://www.npmjs.com/package/@paypal/common-components) [![build status](https://img.shields.io/travis/paypal/paypal-common-components/master.svg?style=flat-square)](https://travis-ci.org/paypal/paypal-common-components)

[![dependencies Status](https://david-dm.org/paypal/paypal-common-components/status.svg)](https://david-dm.org/paypal/paypal-common-components) [![devDependencies Status](https://david-dm.org/paypal/paypal-common-components/dev-status.svg)](https://david-dm.org/paypal/paypal-common-components?type=dev)
[![build status][build-badge]][build]
[![code coverage][coverage-badge]][coverage]
[![npm version][version-badge]][package]
[![apache license][license-badge]][license]

[build-badge]: https://img.shields.io/github/workflow/status/paypal/paypal-common-components/build?logo=github&style=flat-square
[build]: https://github.com/paypal/paypal-common-components/actions?query=workflow%3Abuild
[coverage-badge]: https://img.shields.io/codecov/c/github/paypal/paypal-common-components.svg?style=flat-square
[coverage]: https://codecov.io/github/paypal/paypal-common-components/
[version-badge]: https://img.shields.io/npm/v/@paypal/common-components.svg?style=flat-square
[package]: https://www.npmjs.com/package/@paypal/common-components
[license-badge]: https://img.shields.io/npm/l/@paypal/common-components.svg?style=flat-square
[license]: https://github.com/paypal/paypal-common-components/blob/master/LICENSE

Common components for the PayPal JavaScript SDK

Expand Down
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */
/* eslint import/no-commonjs: off */

// $FlowFixMe
module.exports = {

};
2 changes: 2 additions & 0 deletions src/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ function protectedExport<T>(xport : T) : ?T {
}

export const ThreeDomainSecure = {
// $FlowFixMe
__get__: () => protectedExport(getThreeDomainSecureComponent())
};

export const postRobot = {
// $FlowFixMe
__get__: () => protectedExport(postRobotModule)
};
4 changes: 2 additions & 2 deletions test/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ export const fundingEligibility = {
export const testGlobals = {
__paypal_checkout__: {
serverConfig: {
fundingEligibility: () => `window.__TEST_FUNDING_ELIGIBILITY__ || ${ JSON.stringify(fundingEligibility) }`
fundingEligibility: () : string => `window.__TEST_FUNDING_ELIGIBILITY__ || ${ JSON.stringify(fundingEligibility) }`
}
},

__PAYPAL_CHECKOUT__: {
__REMEMBERED_FUNDING__: () => 'window.__TEST_REMEMBERED_FUNDING__ || []'
__REMEMBERED_FUNDING__: () : string => 'window.__TEST_REMEMBERED_FUNDING__ || []'
},

__PORT__: 8000,
Expand Down
7 changes: 4 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/* @flow */
/* eslint import/no-nodejs-modules: off, import/no-default-export: off */

import type { WebpackConfig } from 'grumbler-scripts/config/types';
import { getWebpackConfig } from 'grumbler-scripts/config/webpack.config';

import { testGlobals } from './test/globals';
import globals from './globals';

const MODULE_NAME = 'paypal';

export const WEBPACK_CONFIG_UI = getWebpackConfig({
export const WEBPACK_CONFIG_UI : WebpackConfig = getWebpackConfig({
context: __dirname,
entry: './src/ui',
filename: 'ui',
Expand All @@ -19,7 +20,7 @@ export const WEBPACK_CONFIG_UI = getWebpackConfig({
vars: globals
});

export const WEBPACK_CONFIG_UI_MIN = getWebpackConfig({
export const WEBPACK_CONFIG_UI_MIN : WebpackConfig = getWebpackConfig({
context: __dirname,
entry: './src/ui',
filename: 'ui',
Expand All @@ -29,7 +30,7 @@ export const WEBPACK_CONFIG_UI_MIN = getWebpackConfig({
vars: globals
});

export const WEBPACK_CONFIG_TEST = getWebpackConfig({
export const WEBPACK_CONFIG_TEST : WebpackConfig = getWebpackConfig({
entry: './test/paypal.js',
libraryTarget: 'window',

Expand Down

0 comments on commit e78a77c

Please sign in to comment.