-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable CI platforms to build Linux, Windows and OS X releases #63
Changes from 101 commits
5f4b5c6
4f81b44
d4a3457
06fd74b
2997004
aedf597
b895334
0e5d8dd
5dec6c4
5d6da67
3827fb2
eb57c14
2d0e1f9
e2fe196
83afcc3
7d2267d
29c0c4a
0ac0e72
23abdeb
5c856f2
87e571e
a011055
2c27132
bee2f94
2b83e69
1a16385
0563675
e41a435
1dd78b5
8c05123
e132f65
8fad4d7
2bfbf5d
51e7ebd
be2e085
3405a96
e4287dd
f99625d
f4222f6
131c35e
814b121
12b1663
60f9023
c38f288
153c08a
a06bebf
353b032
98ec707
a3ff530
6bff159
476d690
2a3183c
21a1071
475c082
5e74260
38b65e0
9cbb9cd
dcd04aa
5bc57e3
56837e3
beeeec1
f161a07
4ec838a
a24d7fa
0161fda
e416deb
63056cc
d3ec2e0
a6cef24
cf49276
068399f
b7781fe
cc257b7
5846500
d0ddfca
7bca355
a8c0007
416727d
5565f69
c8366be
16074a8
0ab9188
8afaf50
fea522b
50c728b
7b7a265
e61bddf
a8c5a89
b308e9f
1b85311
0868830
cb7b0a2
324f7bf
7e66d21
a5b0e51
1d0b175
4d7fd09
4625de9
2225b5a
0880a4e
582bb93
890ac78
4a2c81c
1b78585
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,17 @@ workflows: | |
jobs: | ||
- test-node-v6 | ||
- test-node-v8 | ||
- docker-build | ||
- docker-push: | ||
- docker-build: | ||
requires: | ||
- test-node-v6 | ||
- test-node-v8 | ||
- docker-push: | ||
requires: | ||
- docker-build | ||
- electron-pack-and-release: | ||
requires: | ||
- test-node-v6 | ||
- test-node-v8 | ||
|
||
version: 2 | ||
jobs: | ||
|
@@ -31,11 +36,22 @@ jobs: | |
command: | | ||
echo "npm: $(npm --version)" | ||
echo "node: $(node --version)" | ||
- restore_cache: | ||
key: v1-source-{{ .Branch }}-{{ .Revision }} | ||
keys: | ||
- v1-source-{{ .Branch }}- | ||
- v1-source- | ||
- checkout | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Falcon, we also keep a cache for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, @n-riesco, how about now?: https://circleci.com/gh/plotly/image-exporter/1175#config/containers/0 |
||
- save_cache: | ||
key: v1-source-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- ".git" | ||
- restore_cache: | ||
key: v2-npm-{{ checksum "package-lock.json" }} | ||
keys: | ||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} | ||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} | ||
- v2-npm- | ||
- run: node --version | ||
- run: npm --version | ||
- run: | ||
name: Install deps | ||
command: | | ||
|
@@ -44,15 +60,15 @@ jobs: | |
- run: | ||
name: List deps | ||
command: | | ||
npm ls | ||
npm list | ||
pdftops -v | ||
- save_cache: | ||
key: v2-npm-{{ checksum "package-lock.json" }} | ||
paths: | ||
- node_modules | ||
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package.json" }} | ||
- run: | ||
name: Test | ||
command: npm test | ||
command: npm run test | ||
- run: | ||
name: Coverage | ||
command: npm run coverage | ||
|
@@ -62,38 +78,50 @@ jobs: | |
test-node-v6: | ||
<<: *base | ||
docker: | ||
- image: circleci/node:6.10.3-browsers | ||
- image: circleci/node:6-browsers | ||
|
||
test-node-v8: | ||
<<: *base | ||
docker: | ||
- image: circleci/node:8.4.0-browsers | ||
- image: circleci/node:8-browsers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etpinard My rationale, is that this software is made to run on many people's personal computers, with diverse versioning profiles, rather than servers for which Plotly has complete control to use only one very precise version. I am happy to revert this change if Plotly wishes me to do so, otherwise I vote to keep this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer locking down the image versions. I don't think this project is likely to break from one minor release of node.js to another. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I have made this change. How's it look? |
||
|
||
docker-build: | ||
docker: | ||
- image: circleci/node:6.10.3-browsers | ||
|
||
- image: circleci/node:8-browsers | ||
steps: | ||
- setup_remote_docker: | ||
reusable: true | ||
|
||
- restore_cache: | ||
key: v1-source-{{ .Branch }}-{{ .Revision }} | ||
keys: | ||
- v1-source-{{ .Branch }}- | ||
- v1-source- | ||
- checkout | ||
|
||
- save_cache: | ||
key: v1-source-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- ".git" | ||
- restore_cache: | ||
keys: | ||
- v2-npm-{{ checksum "package-lock.json" }} | ||
- run: | ||
name: Build Docker image | ||
command: | | ||
docker build -f deployment/Dockerfile -t quay.io/plotly/image-exporter:$CIRCLE_SHA1 . | ||
|
||
- run: | ||
name: Smoke test Docker image | ||
command: | | ||
docker run -d -p 9091:9091/tcp --name imageserver quay.io/plotly/image-exporter:$CIRCLE_SHA1 | ||
docker run --network container:imageserver quay.io/plotly/wget wget --retry-connrefused --waitretry=1 -t 60 -O /dev/null --progress=dot http://localhost:9091/ping | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v2-npm-{{ checksum "package-lock.json" }} | ||
|
||
docker-push: | ||
docker: | ||
- image: circleci/node:6.10.3-browsers | ||
- image: circleci/node:8-browsers | ||
|
||
steps: | ||
- setup_remote_docker: | ||
|
@@ -106,3 +134,37 @@ jobs: | |
docker tag quay.io/plotly/image-exporter:$CIRCLE_SHA1 quay.io/plotly/image-exporter:$CIRCLE_BRANCH | ||
docker push quay.io/plotly/image-exporter:$CIRCLE_SHA1 | ||
docker push quay.io/plotly/image-exporter:$CIRCLE_BRANCH | ||
|
||
electron-pack-and-release: | ||
docker: | ||
- image: circleci/node:8-browsers | ||
steps: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd add the same steps to save and restore caches for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @n-riesco good call. Okay, I have added these caches: https://circleci.com/gh/plotly/image-exporter/1201#config/containers/0. I ran the builds twice after this change, to ensure it worked with and without a primed cache—all good. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JamesCropcho In Falcon we use 2 caches: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are correct, @n-riesco . I have changed the CircleCI caching strategy as per your recommendations, and tested with fresh and primed caches. |
||
- restore_cache: | ||
key: v1-source-{{ .Branch }}-{{ .Revision }} | ||
keys: | ||
- v1-source-{{ .Branch }}- | ||
- v1-source- | ||
- checkout | ||
- save_cache: | ||
key: v1-source-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- ".git" | ||
- restore_cache: | ||
key: v2-npm-{{ checksum "package-lock.json" }} | ||
keys: | ||
- v2-npm- | ||
- run: node --version | ||
- run: npm --version | ||
- run: npm install | ||
- run: | ||
name: Electron-Builder pack | ||
command: npm run pack | ||
- save_cache: | ||
key: v2-npm-{{ checksum "package-lock.json" }} | ||
paths: | ||
- node_modules | ||
- run: mkdir artifacts | ||
- run: mv release/*.yml artifacts || true | ||
- run: mv release/image-exporter* artifacts | ||
- store_artifacts: | ||
path: artifacts |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ coverage | |
.nyc_output | ||
|
||
/build | ||
dist/ | ||
/release | ||
|
||
deployment/*.retry | ||
|
||
/yarn-error.log |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
matrix: | ||
include: | ||
- os: osx | ||
osx_image: xcode9.0 | ||
language: node_js | ||
node_js: "8" | ||
env: | ||
- ELECTRON_CACHE=$HOME/.cache/electron | ||
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder | ||
|
||
cache: | ||
directories: | ||
- node_modules | ||
- $HOME/.cache/electron | ||
- $HOME/.cache/electron-builder | ||
|
||
install: | ||
- npm install | ||
|
||
script: | ||
- npm run pack | ||
- zip mac-release.zip release/Plotly\ Graph\ Exporter* | ||
|
||
before_cache: | ||
- rm -rf $HOME/.cache/electron-builder/wine | ||
|
||
addons: | ||
artifacts: | ||
s3_region: us-east-1 | ||
paths: mac-release.zip | ||
debug: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: 0.1.{build} | ||
|
||
environment: | ||
matrix: | ||
- nodejs_version: 8 | ||
|
||
platform: | ||
- x64 | ||
|
||
#services: | ||
|
||
cache: | ||
- node_modules | ||
- '%LOCALAPPDATA%\electron\Cache' | ||
- '%LOCALAPPDATA%\electron-builder\cache' | ||
|
||
init: | ||
- git config --global core.autocrlf input | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
|
||
build_script: | ||
- npm run pack | ||
|
||
after_build: | ||
- 7z a release.zip release/latest.yml release/*.exe | ||
|
||
artifacts: | ||
- path: release.zip | ||
name: release | ||
|
||
test: off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job didn't run:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@n-riesco It appears to me that "electron-pack-and-release" is running: https://circleci.com/gh/plotly/image-exporter/tree/test-builds-across-travis-circle-appveyor
(See #1124 for example.)
Please pardon, am I missing something simple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JamesCropcho For some reason, github doesn't show the build (as seen on the above screenshot). Since circleCI runs the job, then this isn't an issue.