Skip to content

Commit e78a77c

Browse files
nbierdemangregjopa
andauthored
Replace Travis CI with GitHub Actions (#16)
* 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 <[email protected]>
1 parent f5a51a6 commit e78a77c

File tree

9 files changed

+61
-35
lines changed

9 files changed

+61
-35
lines changed
File renamed without changes.

.github/workflows/main.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: build
2+
on:
3+
# run on push but only for the master branch
4+
push:
5+
branches:
6+
- master
7+
# run for every pull request
8+
pull_request: {}
9+
jobs:
10+
main:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node: [10.13, 12, 14]
15+
steps:
16+
- name: ⬇️ Checkout repo
17+
uses: actions/checkout@v2
18+
19+
- name: ⎔ Setup node
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node }}
23+
24+
- name: 📥 Download deps
25+
uses: bahmutov/npm-install@v1
26+
with:
27+
useLockFile: false
28+
29+
- name: ▶️ Run flow-typed script
30+
run: npm run flow-typed
31+
32+
- name: ▶️ Run build script
33+
run: npm run build
34+
35+
- name: ⬆️ Upload coverage report
36+
uses: codecov/codecov-action@v1

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

LICENSE.txt renamed to LICENSE

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Apache License
22
Version 2.0, January 2004
3-
http://www.apache.org/licenses/
3+
https://www.apache.org/licenses/
44

55
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
66

@@ -175,24 +175,13 @@
175175

176176
END OF TERMS AND CONDITIONS
177177

178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "{}"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189178
Copyright 2016 PayPal
190179

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

195-
http://www.apache.org/licenses/LICENSE-2.0
184+
https://www.apache.org/licenses/LICENSE-2.0
196185

197186
Unless required by applicable law or agreed to in writing, software
198187
distributed under the License is distributed on an "AS IS" BASIS,

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
PayPal Common Components
22
------------------------
33

4-
[![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)
5-
6-
[![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)
4+
[![build status][build-badge]][build]
5+
[![code coverage][coverage-badge]][coverage]
6+
[![npm version][version-badge]][package]
7+
[![apache license][license-badge]][license]
8+
9+
[build-badge]: https://img.shields.io/github/workflow/status/paypal/paypal-common-components/build?logo=github&style=flat-square
10+
[build]: https://github.com/paypal/paypal-common-components/actions?query=workflow%3Abuild
11+
[coverage-badge]: https://img.shields.io/codecov/c/github/paypal/paypal-common-components.svg?style=flat-square
12+
[coverage]: https://codecov.io/github/paypal/paypal-common-components/
13+
[version-badge]: https://img.shields.io/npm/v/@paypal/common-components.svg?style=flat-square
14+
[package]: https://www.npmjs.com/package/@paypal/common-components
15+
[license-badge]: https://img.shields.io/npm/l/@paypal/common-components.svg?style=flat-square
16+
[license]: https://github.com/paypal/paypal-common-components/blob/master/LICENSE
717

818
Common components for the PayPal JavaScript SDK
919

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* @flow */
22
/* eslint import/no-commonjs: off */
33

4+
// $FlowFixMe
45
module.exports = {
5-
6+
67
};

src/interface.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ function protectedExport<T>(xport : T) : ?T {
1313
}
1414

1515
export const ThreeDomainSecure = {
16+
// $FlowFixMe
1617
__get__: () => protectedExport(getThreeDomainSecureComponent())
1718
};
1819

1920
export const postRobot = {
21+
// $FlowFixMe
2022
__get__: () => protectedExport(postRobotModule)
2123
};

test/globals.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ export const fundingEligibility = {
7676
export const testGlobals = {
7777
__paypal_checkout__: {
7878
serverConfig: {
79-
fundingEligibility: () => `window.__TEST_FUNDING_ELIGIBILITY__ || ${ JSON.stringify(fundingEligibility) }`
79+
fundingEligibility: () : string => `window.__TEST_FUNDING_ELIGIBILITY__ || ${ JSON.stringify(fundingEligibility) }`
8080
}
8181
},
8282

8383
__PAYPAL_CHECKOUT__: {
84-
__REMEMBERED_FUNDING__: () => 'window.__TEST_REMEMBERED_FUNDING__ || []'
84+
__REMEMBERED_FUNDING__: () : string => 'window.__TEST_REMEMBERED_FUNDING__ || []'
8585
},
8686

8787
__PORT__: 8000,

webpack.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
/* @flow */
22
/* eslint import/no-nodejs-modules: off, import/no-default-export: off */
33

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

67
import { testGlobals } from './test/globals';
78
import globals from './globals';
89

910
const MODULE_NAME = 'paypal';
1011

11-
export const WEBPACK_CONFIG_UI = getWebpackConfig({
12+
export const WEBPACK_CONFIG_UI : WebpackConfig = getWebpackConfig({
1213
context: __dirname,
1314
entry: './src/ui',
1415
filename: 'ui',
@@ -19,7 +20,7 @@ export const WEBPACK_CONFIG_UI = getWebpackConfig({
1920
vars: globals
2021
});
2122

22-
export const WEBPACK_CONFIG_UI_MIN = getWebpackConfig({
23+
export const WEBPACK_CONFIG_UI_MIN : WebpackConfig = getWebpackConfig({
2324
context: __dirname,
2425
entry: './src/ui',
2526
filename: 'ui',
@@ -29,7 +30,7 @@ export const WEBPACK_CONFIG_UI_MIN = getWebpackConfig({
2930
vars: globals
3031
});
3132

32-
export const WEBPACK_CONFIG_TEST = getWebpackConfig({
33+
export const WEBPACK_CONFIG_TEST : WebpackConfig = getWebpackConfig({
3334
entry: './test/paypal.js',
3435
libraryTarget: 'window',
3536

0 commit comments

Comments
 (0)