Files
shields/package.json
Paul Melnikow 81560cb0c6 Set up CircleCI (including [github] tests) (#1338)
I don’t like that our build goes red on master all the time due to flaky service tests. I thought I’d look into other CI services that would make it possible to run the scheduled tests nightly without causing those messages to show up.

CircleCI, Heroku CI, and Codeship were obvious choices. Heroku CI wasn’t free and I didn’t have any experience with Codeship, so I looked into CircleCI. I’ve used their 1.0 system a lot though this was my first time on their 2.0 system. As with earlier versions, they’ve put a lot of work into making the build fast – perhaps more than any other CI system I’ve seen.

I had such good results, my goal shifted from scheduled daily builds (that don’t litter our commit history with red builds) to improving the CI experience as a whole.

This change made a big impact:

- Build logs load much, much faster. In the test I just ran, 22 seconds to < 2 seconds, a 90% improvement.
- Status of each step shows up right in the GitHub UI, which makes it much faster to see exactly what’s failed.
- Builds run about 50-75% faster on account of parallelism.
- GitHub service tests are fixed. This has been a long-standing issue.
- Ability to ssh into a build container to debug failures.

Here’s what I did:

- Created custom Docker images with our dependencies. To be honest, I’m not even sure these are necessary, only to install the greenkeeper-lockfile. We could get dejavu from npm. They make startup very fast.
- Created an npm-install stage which loads all dependencies into node_modules and caches them.
- Created separate stages for our main tests, service tests, and frontend tests, and stages to run the main tests and service tests in Node 6. These run in parallel, up to four at a time.
- Separated service test ID output from the service test results themselves. (I check these often during the PR process, when I confirm that service tests actually ran. Because the production Shields server caches the title, after updating it you can’t tell whether the update is taking effect.)
- Added a personal access token for the shields-ci user. This should actually fix the long-standing issue #979. CircleCI provides an option to “Pass secrets to builds from forked pull requests,” which means unlike Travis, they’ll give us enough rope to shoot ourselves in the foot.
- Schedule a daily build, which runs all the service tests.
2017-12-06 15:45:09 -05:00

163 lines
5.5 KiB
JSON

{
"name": "gh-badges",
"version": "1.3.0",
"description": "Official Shields.io badge library.",
"keywords": [
"GitHub",
"badge",
"SVG",
"image",
"shields.io"
],
"homepage": "http://shields.io",
"bugs": {
"url": "https://github.com/badges/shields/issues",
"email": "thaddee.tyl@gmail.com"
},
"license": "CC0-1.0",
"author": "Thaddée Tyl <thaddee.tyl@gmail.com>",
"main": "lib/make-badge.js",
"repository": {
"type": "git",
"url": "https://github.com/badges/shields"
},
"dependencies": {
"camp": "^17.2.0",
"chrome-web-store-item-property": "~1.1.2",
"dot": "~1.1.2",
"gm": "^1.23.0",
"json-autosave": "~1.1.2",
"jsonpath": "~1.0.0",
"lodash.countby": "^4.6.0",
"lodash.mapkeys": "^4.6.0",
"moment": "^2.19.3",
"node-env-flag": "^0.1.0",
"pdfkit": "~0.8.0",
"pretty-bytes": "^4.0.2",
"query-string": "^5.0.0",
"redis": "~2.6.2",
"request": "~2.83.0",
"semver": "~5.4.1",
"svgo": "~0.7.1",
"xml2js": "~0.4.16",
"lodash.uniq": "~4.5.0"
},
"scripts": {
"coverage:test:js": "nyc node_modules/mocha/bin/_mocha '*.spec.js' 'lib/**/*.spec.js' 'service-tests/**/*.spec.js'",
"coverage:test:services": "nyc node_modules/mocha/bin/_mocha --delay service-tests/runner/cli.js",
"coverage:test": "rimraf .nyc_output coverage; npm run coverage:test:js; npm run coverage:test:services",
"coverage:report": "nyc report",
"coverage:report:reopen": "opn coverage/lcov-report/index.html",
"coverage:report:open": "npm run coverage:report && npm run coverage:report:reopen",
"lint": "eslint '**/*.js'",
"test:js:frontend": "mocha --require babel-polyfill --require babel-register 'frontend/**/*.spec.js'",
"test:js:server": "mocha '*.spec.js' 'lib/**/*.spec.js' 'service-tests/**/*.spec.js'",
"test:services": "mocha --delay service-tests/runner/cli.js",
"test:services:pr:prepare": "node service-tests/runner/pull-request-services-cli.js > pull-request-services.log",
"test:services:pr:run": "mocha --delay service-tests/runner/cli.js --stdin < pull-request-services.log",
"test:services:pr": "npm run test:services:pr:prepare && npm run test:services:pr:run",
"test": "npm run lint && npm run test:js:frontend && npm run test:js:server",
"circle-images:build": "docker build -t shieldsio/shields-node-8:${IMAGE_TAG} -f .circleci/images/node-8/Dockerfile . && docker build -t shieldsio/shields-node-6:${IMAGE_TAG} -f .circleci/images/node-6/Dockerfile .",
"circle-images:push": "docker push shieldsio/shields-node-8:${IMAGE_TAG} && docker push shieldsio/shields-node-6:${IMAGE_TAG}",
"frontend-depcheck": "check-node-version --node \">= 8.0\"",
"server-depcheck": "check-node-version --node \">= 6.0 < 9.0\"",
"postinstall": "npm run server-depcheck",
"prebuild": "npm run frontend-depcheck",
"build": "next build && next export -o build/",
"heroku-postbuild": "npm run build",
"analyze": "ANALYZE=true LONG_CACHE=false BASE_URL=https://img.shields.io npm run build",
"start:server": "node server 8080 ::",
"now-start": "node server",
"prestart": "npm run frontend-depcheck",
"start": "concurrently --names server,frontend \"ALLOWED_ORIGIN=http://localhost:3000 npm run start:server\" \"BASE_URL=http://[::]:8080 next dev\""
},
"bin": {
"badge": "lib/badge-cli.js"
},
"files": [
"README.md",
"lib/badge-cli.js",
"lib/make-badge.js",
"lib/colorscheme.json",
"lib/lru-cache.js",
"lib/measure-text.js",
"lib/svg-to-img.js",
"templates",
"logo"
],
"devDependencies": {
"@mapbox/react-click-to-select": "^2.1.0",
"babel-eslint": "^8.0.2",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"check-node-version": "^3.1.0",
"child-process-promise": "^2.2.1",
"classnames": "^2.2.5",
"concurrently": "^3.5.1",
"dejavu-fonts-ttf": "^2.37.3",
"eslint": "^4.8.0",
"eslint-config-prettier": "^2.6.0",
"eslint-config-standard": "^10.2.1",
"eslint-config-standard-jsx": "^4.0.2",
"eslint-config-standard-react": "^5.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"fetch-ponyfill": "^4.1.0",
"glob": "^7.1.1",
"icedfrisby": "^1.4.0",
"icedfrisby-nock": "^1.0.0",
"is-png": "^1.1.0",
"is-svg": "^2.1.0",
"lodash.debounce": "^4.0.8",
"lodash.difference": "^4.5.0",
"lodash.mapvalues": "^4.6.0",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"mocha": "^4.0.1",
"next": "^4.1.4",
"nock": "^9.0.13",
"node-fetch": "^1.6.3",
"nyc": "^11.2.1",
"opn-cli": "^3.1.0",
"prettier": "1.9.1",
"pretty": "^2.0.0",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-modal": "^3.1.2",
"read-all-stdin-sync": "^1.0.5",
"rimraf": "^2.6.2",
"sazerac": "^0.4.2",
"semver-regex": "^1.0.0",
"sinon": "^4.0.1",
"url": "^0.11.0"
},
"greenkeeper": {
"ignore": [
"redis"
]
},
"engines": {
"node": "8.x",
"npm": "5.x"
},
"babel": {
"presets": [
"next/babel",
"env"
],
"plugins": [
"transform-class-properties"
]
},
"collective": {
"type": "opencollective",
"url": "https://opencollective.com/shields",
"logo": "https://opencollective.com/opencollective/logo.txt"
}
}