Skip to content

Commit fef4df5

Browse files
authored
ci: Migrate fully to gh actions (#2821)
* ci: Integration tests * ci: Secrets * ci: Next try * feat: Name and Upload to zeus * feat: Danger and codcov action * ci: Try cache * ci: All the changes * ci: Fix zeus * ref: Upload artifacts with github sha * ref: Remove danger and run Browserstack on master * ref: Update Build badge * ref: Codereview
1 parent a0c7221 commit fef4df5

File tree

28 files changed

+161
-463
lines changed

28 files changed

+161
-463
lines changed

.github/workflows/build.yml

Lines changed: 114 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,16 @@ jobs:
1616
- uses: actions/cache@v2
1717
with:
1818
path: |
19-
node_modules
20-
*/*/node_modules
19+
${{ github.workspace }}/node_modules
20+
${{ github.workspace }}/packages/**/node_modules
21+
${{ github.workspace }}/packages/**/build
22+
${{ github.workspace }}/packages/**/dist
23+
${{ github.workspace }}/packages/**/esm
2124
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
2225
- name: Install
2326
run: yarn install
2427
- name: Build
2528
run: yarn build
26-
- name: Archive production artifacts
27-
uses: actions/upload-artifact@v2
28-
with:
29-
name: build
30-
path: |
31-
${{ github.workspace }}/packages/**/build
32-
${{ github.workspace }}/packages/**/dist
33-
${{ github.workspace }}/packages/**/esm
3429

3530
job_size_check:
3631
name: Size Check
@@ -42,13 +37,12 @@ jobs:
4237
- uses: actions/cache@v2
4338
with:
4439
path: |
45-
node_modules
46-
*/*/node_modules
40+
${{ github.workspace }}/node_modules
41+
${{ github.workspace }}/packages/**/node_modules
42+
${{ github.workspace }}/packages/**/build
43+
${{ github.workspace }}/packages/**/dist
44+
${{ github.workspace }}/packages/**/esm
4745
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
48-
- uses: actions/download-artifact@v2
49-
with:
50-
name: build
51-
path: ${{ github.workspace }}/packages
5246
- uses: andresz1/[email protected]
5347
with:
5448
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -64,14 +58,13 @@ jobs:
6458
- uses: actions/cache@v2
6559
with:
6660
path: |
67-
node_modules
68-
*/*/node_modules
61+
${{ github.workspace }}/node_modules
62+
${{ github.workspace }}/packages/**/node_modules
63+
${{ github.workspace }}/packages/**/build
64+
${{ github.workspace }}/packages/**/dist
65+
${{ github.workspace }}/packages/**/esm
6966
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
7067
- run: yarn install
71-
- uses: actions/download-artifact@v2
72-
with:
73-
name: build
74-
path: ${{ github.workspace }}/packages
7568
- name: Run Linter
7669
run: yarn lint
7770

@@ -85,13 +78,105 @@ jobs:
8578
- uses: actions/cache@v2
8679
with:
8780
path: |
88-
node_modules
89-
*/*/node_modules
81+
${{ github.workspace }}/node_modules
82+
${{ github.workspace }}/packages/**/node_modules
83+
${{ github.workspace }}/packages/**/build
84+
${{ github.workspace }}/packages/**/dist
85+
${{ github.workspace }}/packages/**/esm
9086
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
9187
- run: yarn install
92-
- uses: actions/download-artifact@v2
93-
with:
94-
name: build
95-
path: ${{ github.workspace }}/packages
9688
- name: Unit Tests
97-
run: yarn test
89+
run: yarn test --ignore="@sentry/ember"
90+
- uses: codecov/codecov-action@v1
91+
92+
job_browserstack_test:
93+
name: BrowserStack
94+
needs: job_build
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v2
98+
- uses: actions/setup-node@v1
99+
- uses: actions/cache@v2
100+
with:
101+
path: |
102+
${{ github.workspace }}/node_modules
103+
${{ github.workspace }}/packages/**/node_modules
104+
${{ github.workspace }}/packages/**/build
105+
${{ github.workspace }}/packages/**/dist
106+
${{ github.workspace }}/packages/**/esm
107+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
108+
- run: yarn install
109+
- name: Integration Tests
110+
env:
111+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
112+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
113+
if: "'refs/heads/master' == github.ref || startsWith(github.ref, 'refs/tags/')"
114+
run: |
115+
cd packages/browser
116+
yarn test:integration:checkbrowsers
117+
yarn test:integration
118+
yarn test:package
119+
120+
job_zeus:
121+
name: Zeus
122+
needs: job_build
123+
runs-on: ubuntu-latest
124+
steps:
125+
- uses: actions/checkout@v2
126+
- uses: actions/setup-node@v1
127+
- uses: actions/cache@v2
128+
with:
129+
path: |
130+
${{ github.workspace }}/node_modules
131+
${{ github.workspace }}/packages/**/node_modules
132+
${{ github.workspace }}/packages/**/build
133+
${{ github.workspace }}/packages/**/dist
134+
${{ github.workspace }}/packages/**/esm
135+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
136+
- run: yarn install
137+
- name: Install Zeus
138+
run: |
139+
yarn global add @zeus-ci/cli
140+
echo "::add-path::$(yarn global bin)"
141+
- name: Upload to Zeus
142+
env:
143+
ZEUS_API_TOKEN: ${{ secrets.ZEUS_API_TOKEN }}
144+
ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }}
145+
run: |
146+
zeus job update -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -r $GITHUB_SHA
147+
yarn pack:changed
148+
zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/tar+npm" ./packages/**/*.tgz
149+
zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/javascript" ./packages/browser/build/*
150+
zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/javascript" ./packages/integrations/build/*
151+
zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/javascript" ./packages/apm/build/*
152+
zeus upload -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -t "application/javascript" ./packages/tracing/build/*
153+
zeus job update --status=passed -b $GITHUB_RUN_ID -j $GITHUB_RUN_NUMBER -r $GITHUB_SHA
154+
155+
job_artifacts:
156+
name: Artifacts Upload
157+
needs: job_build
158+
runs-on: ubuntu-latest
159+
steps:
160+
- uses: actions/checkout@v2
161+
- uses: actions/setup-node@v1
162+
- uses: actions/cache@v2
163+
with:
164+
path: |
165+
${{ github.workspace }}/node_modules
166+
${{ github.workspace }}/packages/**/node_modules
167+
${{ github.workspace }}/packages/**/build
168+
${{ github.workspace }}/packages/**/dist
169+
${{ github.workspace }}/packages/**/esm
170+
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
171+
- name: Pack
172+
run: yarn pack:changed
173+
- name: Archive Artifacts
174+
uses: actions/upload-artifact@v2
175+
with:
176+
name: ${{ github.sha }}
177+
path: |
178+
${{ github.workspace }}/packages/browser/build/**
179+
${{ github.workspace }}/packages/integrations/build/**
180+
${{ github.workspace }}/packages/apm/build/**
181+
${{ github.workspace }}/packages/tracing/build/**
182+
${{ github.workspace }}/packages/**/*.tgz

.travis.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ cache:
2020

2121
jobs:
2222
include:
23-
- stage: Test
24-
name: '@sentry/packages - build + lint + test + codecov + danger [node v12]'
25-
node_js: '12'
26-
script: scripts/danger.sh
2723
- name: '@sentry/packages - build and test [node v6]'
2824
node_js: '6'
2925
script: scripts/test.sh
@@ -36,15 +32,6 @@ jobs:
3632
- name: '@sentry/packages - build and test [node v12]'
3733
node_js: '12'
3834
script: scripts/test.sh
39-
- name: '@sentry/browser - browserstack integration tests'
40-
node_js: '12'
41-
script: scripts/browser-integration.sh
42-
if: fork = false
43-
- stage: Deploy
44-
name: '@sentry/packages - pack and zeus upload'
45-
node_js: '12'
46-
if: branch =~ ^release/
47-
script: scripts/pack-and-upload.sh
4835

4936
notifications:
5037
webhooks:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<br />
66
</p>
77

8-
[![Build Status](https://travis-ci.com/getsentry/sentry-javascript.svg?branch=master)](https://travis-ci.com/getsentry/sentry-javascript)
8+
![Build & Test](https://github.com/getsentry/sentry-javascript/workflows/Build%20&%20Test/badge.svg)
99
[![codecov](https://codecov.io/gh/getsentry/sentry-javascript/branch/master/graph/badge.svg)](https://codecov.io/gh/getsentry/sentry-javascript)
1010
[![npm version](https://img.shields.io/npm/v/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core)
1111
[![typedoc](https://img.shields.io/badge/docs-typedoc-blue.svg)](http://getsentry.github.io/sentry-javascript/)

dangerfile.ts

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"lint": "lerna run --stream --concurrency 1 lint",
1212
"test": "lerna run --stream --concurrency 1 --sort test",
1313
"codecov": "codecov",
14+
"pack:changed": "lerna run pack --since",
1415
"postpublish": "make publish-docs"
1516
},
1617
"volta": {
@@ -47,7 +48,6 @@
4748
"@types/sinon": "^7.0.11",
4849
"chai": "^4.1.2",
4950
"codecov": "^3.6.5",
50-
"danger": "^7.1.3",
5151
"jest": "^24.7.1",
5252
"karma-browserstack-launcher": "^1.5.1",
5353
"karma-firefox-launcher": "^1.1.0",

packages/angular/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
4848
"fix": "run-s fix:eslint fix:prettier",
4949
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
50-
"fix:eslint": "eslint . --format stylish --fix"
50+
"fix:eslint": "eslint . --format stylish --fix",
51+
"pack": "npm pack"
5152
},
5253
"sideEffects": false
5354
}

packages/apm/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
5858
"fix:eslint": "eslint . --format stylish --fix",
5959
"test": "jest",
60-
"test:watch": "jest --watch"
60+
"test:watch": "jest --watch",
61+
"pack": "npm pack"
6162
},
6263
"jest": {
6364
"collectCoverage": true,

packages/browser/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
"size:check": "run-p size:check:es5 size:check:es6",
8282
"size:check:es5": "cat build/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
8383
"size:check:es6": "cat build/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",
84-
"version": "node ../../scripts/versionbump.js src/version.ts"
84+
"version": "node ../../scripts/versionbump.js src/version.ts",
85+
"pack": "npm pack"
8586
},
8687
"sideEffects": false
8788
}

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
4848
"fix:eslint": "eslint . --format stylish --fix",
4949
"test": "jest",
50-
"test:watch": "jest --watch"
50+
"test:watch": "jest --watch",
51+
"pack": "npm pack"
5152
},
5253
"jest": {
5354
"collectCoverage": true,

packages/ember/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"test:ember": "ember test",
2727
"test:ember-compatibility": "ember try:each",
2828
"prepublishOnly": "ember ts:precompile",
29-
"postpublish": "ember ts:clean"
29+
"postpublish": "ember ts:clean",
30+
"pack": "npm pack"
3031
},
3132
"dependencies": {
3233
"@sentry/browser": "5.21.1",

0 commit comments

Comments
 (0)