Skip to content

Commit 93f17e7

Browse files
Merge pull request #84 from BranchMetrics/main
[RELEASE] 02/20/23
2 parents 3546bf2 + 8069f73 commit 93f17e7

File tree

17 files changed

+9671
-3911
lines changed

17 files changed

+9671
-3911
lines changed

.github/workflows/deploy-master.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
inputs:
55
branch_name:
6-
description: 'Name of the branch'
6+
description: 'Enter name of the branch'
77
required: true
88
default: 'main'
99

@@ -23,7 +23,7 @@ env:
2323
jobs:
2424
test-unit:
2525
name: Unit tests
26-
runs-on: small
26+
runs-on: [ self-hosted, standard ]
2727
steps:
2828
- name: Checkout ${{ github.ref_name }}
2929
uses: actions/checkout@v3
@@ -43,15 +43,27 @@ jobs:
4343
run: npm install
4444

4545
- name: Run tests
46-
run: echo "Running tests"
46+
id: runTests
47+
run: npm run test
48+
49+
- name : upload codecov
50+
uses: codecov/codecov-action@v3
51+
if: steps.runTests.outcome == 'success'
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
4754

4855
test-lint:
4956
name: Lint
50-
runs-on: small
57+
runs-on: [ self-hosted, standard ]
5158
steps:
5259
- name: Checkout ${{ github.ref_name }}
5360
uses: actions/checkout@v3
5461

62+
- name: Setup .npmrc
63+
uses: bduff9/[email protected]
64+
with:
65+
dot-npmrc: ${{ secrets.DOT_NPMRC }}
66+
5567
- name: Install Node ${{ env.NODE_VERSION }}
5668
uses: actions/setup-node@v3
5769
with:
@@ -68,7 +80,7 @@ jobs:
6880
name: Deploy-QA
6981
needs: [test-unit,test-lint]
7082
if: ${{ github.ref_name == 'main' && github.event.pull_request.merged == true }}
71-
runs-on: small
83+
runs-on: [ self-hosted, standard ]
7284
steps:
7385
- name: Checkout ${{ github.ref_name }}
7486
uses: actions/checkout@v3
@@ -88,6 +100,7 @@ jobs:
88100
run: npm install
89101

90102
- name: Call the Build bash script for QA
103+
id: build
91104
run: bash ${GITHUB_WORKSPACE}/deployment/build-qa.sh
92105

93106
- name: Sync S3 Builds

.github/workflows/deploy-prod.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
jobs:
2424
test-unit:
2525
name: Unit tests
26-
runs-on: small
26+
runs-on: [ self-hosted, standard ]
2727
steps:
2828
- name: Checkout ${{ github.ref_name }}
2929
uses: actions/checkout@v3
@@ -47,7 +47,7 @@ jobs:
4747

4848
test-lint:
4949
name: Lint
50-
runs-on: small
50+
runs-on: [ self-hosted, standard ]
5151
steps:
5252
- name: Checkout ${{ github.ref_name }}
5353
uses: actions/checkout@v3
@@ -68,11 +68,11 @@ jobs:
6868
- name: Lint tests
6969
run: npm run lint
7070

71-
build-deploy-qa:
72-
name: Deploy-QA
71+
build-deploy-prod:
72+
name: Deploy-Prod
7373
needs: [test-lint, test-unit]
7474
if: ${{ github.ref_name == 'production' && github.event.pull_request.merged == true }}
75-
runs-on: small
75+
runs-on: [ self-hosted, standard ]
7676
steps:
7777
- name: Checkout ${{ github.ref_name }}
7878
uses: actions/checkout@v3
@@ -101,9 +101,18 @@ jobs:
101101
if: steps.build.outcome == 'success'
102102
run: aws s3 sync ./dist s3://branch-builds/connected-sdk/
103103

104+
- name: Sync S3 CDN
105+
id: s3synccdn
106+
if: steps.s3syncbuilds.outcome == 'success'
107+
run: aws s3 cp ./dist/branch-connected.min.js s3://branch-cdn/branch-connected.min.js
108+
109+
- name: Remove npmrc
110+
run: rm -f ~/.npmrc
111+
104112
- name: publish
105113
if: steps.s3synccdn.outcome == 'success'
106114
uses: JS-DevTools/npm-publish@v1
107115
with:
108116
token: ${{ secrets.NPM_TOKEN }}
109117

118+

.github/workflows/gate-keep.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
jobs:
1818
test-unit:
1919
name: Unit tests
20-
runs-on: small
20+
runs-on: [ self-hosted, standard ]
2121
steps:
2222
- name: Checkout ${{ github.ref_name }}
2323
uses: actions/checkout@v3
@@ -41,7 +41,7 @@ jobs:
4141

4242
test-lint:
4343
name: Lint
44-
runs-on: small
44+
runs-on: [ self-hosted, standard ]
4545
steps:
4646
- name: Checkout ${{ github.ref_name }}
4747
uses: actions/checkout@v3
@@ -66,7 +66,7 @@ jobs:
6666
test-build:
6767
name: Test-build
6868
needs: [test-unit,test-lint]
69-
runs-on: small
69+
runs-on: [ self-hosted, standard ]
7070
steps:
7171
- name: Checkout ${{ github.ref_name }}
7272
uses: actions/checkout@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ tmp
3131
local-testbench
3232
index.html
3333
dist
34+
.nyc_output

.mocharc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
// This is a JavaScript-based config file containing every Mocha option plus others.
4+
// If you need conditional logic, you might want to use this type of config,
5+
// e.g. set options via environment variables 'process.env'.
6+
// Otherwise, JSON or YAML is recommended.
7+
8+
module.exports = {
9+
require: ['./node_modules/google-closure-library', './test/branch-deps.js', './node_modules/jsdom-global/register.js', './test/test-utils.js', './node_modules/sinon/lib/sinon.js'],
10+
spec: ['./test/1_utils.js']
11+
};

.nycrc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"reporter": [
3+
"text-summary",
4+
"html",
5+
"lcovonly"
6+
],
7+
"include": [
8+
"src/**"
9+
],
10+
"exclude": [
11+
"coverage/**",
12+
"docs/**",
13+
"packages/*/test{,s}/**",
14+
"**/*.d.ts",
15+
"test{,s}/**",
16+
"test{,-*}.{js,cjs,mjs,ts}",
17+
"**/*{.,-}test.{js,cjs,mjs,ts}",
18+
"**/__tests__/**",
19+
"**/{karma,rollup,webpack}.config.js",
20+
"**/{babel.config,.eslintrc,.mocharc}.{js,cjs}",
21+
"lib/browser/**",
22+
"package-scripts.js",
23+
"scripts/**",
24+
"dist/**",
25+
"src/onpage.js",
26+
"src/extern.js",
27+
"src/7_initialization.js"
28+
]
29+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ All notable changes to the Branch C onnected SDK will be documented here.
33
The Branch Connected SDK adheres to [Semantic Versioning](http://semver.org/).
44

55
## [VERSION] - unreleased
6+
7+
## [1.2.0] - 2023-02-17
8+
– Fix GHA CI/CD

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ test/branch-deps.js: $(SOURCES)
3939
--f node_modules/google-closure-library/closure/goog/deps.js \
4040
--root src \
4141
--root test \
42+
--exclude src/0_config.js \
4243
--exclude test/branch-deps.js > test/branch-deps.js.tmp
4344
echo "// jscs:disable" | cat - test/branch-deps.js.tmp | sed -e 's#src/0_config.js#test/web-config.js#' > test/branch-deps.js && \
4445
rm test/branch-deps.js.tmp

deployment/build-qa.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ NC='\033[0m'
2020

2121
echo -en "${GREEN}call make ...${NC}\n"
2222
make
23-
23+
aws s3 sync ./dist s3://branch-builds/connected-sdk/
2424
# Exit prompts
2525
echo -en "${GREEN}Done build for QA release...${NC}\n"

0 commit comments

Comments
 (0)