Files
shields/.circleci/config.yml
Marcin Mielnicki eeb78ccf15 Badge suggestion feature fix (#3331)
* Display suggested badges

* E2e test for badge suggestion

* Suggest resource returns example with pattern

* Do not require preview in MarkupModalContent

* Skip integration test for suggestion

* Unmodifiable path in customizer

* Use suggested link

* Allow to change suggested badges

* Enable skipped test

* Enable skipped test

* Code refactoring

* Code refactoring

* Code refactoring

* Code refactoring

* Code refactoring

* Code refactoring

* Unused code removed

* Unused code removed

* getExampleWithServiceByPattern helper added

* BadgeExamples uses examples instead of services definitions

* Revert "getExampleWithServiceByPattern helper added"

This reverts commit 80839fd705.

* style removed from example

* example.exact replaced with preview.buildFromExample

* keywords are required again

* Code refactoring

* More e2e tests for suggestion feature

* Code refactoring

* Build add with a base url

* showActualParams -> isPrefilled

* A new schema for BadgeExamples

* Link moved to queryParams

* Updated documentation for the suggest reponse format

* Link moved to queryParams - another test updated

* Revert "Link moved to queryParams - another test updated"

This reverts commit b5f811bb07.

* Revert "Link moved to queryParams"

This reverts commit 3b54c6d2b4.

* Disable changes in path in suggested badges

* 'link' element documentation restored
2019-04-29 18:38:27 +02:00

412 lines
9.6 KiB
YAML

version: 2
jobs:
npm-install:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package-lock.json" }}
main:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- save_cache:
paths:
- node_modules
key: v2-dependencies-{{ checksum "package-lock.json" }}
- run:
name: Linter
when: always
command: npm run lint
- run:
name: Core tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/core/results.xml
command: npm run test:core
- run:
name: Tests for gh-badges package
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/gh-badges/results.xml
command: npm run test:package
- store_test_results:
path: junit
- run:
name: 'Prettier check (quick fix: `npm run prettier`)'
when: always
command: npm run prettier:check
main@node-latest:
docker:
- image: circleci/node:latest
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Linter
when: always
command: npm run lint
- run:
name: Core tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/core/results.xml
command: npm run test:core
- run:
name: Tests for gh-badges package
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/gh-badges/results.xml
command: npm run test:package
- store_test_results:
path: junit
- run:
name: 'Prettier check (quick fix: `npm run prettier`)'
when: always
command: npm run prettier:check
integration:
docker:
- image: circleci/node:8
- image: redis
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Integration tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/integration/results.xml
command: npm run test:integration
- store_test_results:
path: junit
integration@node-latest:
docker:
- image: circleci/node:latest
- image: redis
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Integration tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/integration/results.xml
command: npm run test:integration
- store_test_results:
path: junit
danger:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Danger
when: always
environment:
# https://github.com/gatsbyjs/gatsby/pull/11555
NODE_ENV: test
command: npm run danger ci
frontend:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Prepare frontend tests
command: npm run defs && npm run features
- run:
name: Frontend unit tests
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/frontend/results.xml
command: npm run test:frontend
- store_test_results:
path: junit
- run:
name: Frontend build completes successfully
when: always
command: npm run build
services:
docker:
- image: circleci/node:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Identify services tagged in the PR title
command: npm run test:services:pr:prepare
- run:
name: Run tests for tagged services
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/services/results.xml
command: npm run test:services:pr:run
- store_test_results:
path: junit
services@node-latest:
docker:
- image: circleci/node:latest
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Identify services tagged in the PR title
command: npm run test:services:pr:prepare
- run:
name: Run tests for tagged services
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/services/results.xml
command: npm run test:services:pr:run
- store_test_results:
path: junit
e2e:
docker:
- image: cypress/base:8
steps:
- checkout
- restore_cache:
keys:
- v2-dependencies-{{ checksum "package-lock.json" }}
# https://github.com/badges/shields/issues/1937
- v2-dependencies-
- run:
name: Install dependencies
command: npm ci
- run:
name: Frontend build
command: GATSBY_BASE_URL=http://localhost:8080 npm run build
- run:
name: Run tests
environment:
CYPRESS_REPORTER: junit
MOCHA_FILE: junit/e2e/results.xml
command: npm run e2e-on-build
- store_test_results:
path: junit
- store_artifacts:
path: cypress/videos
- store_artifacts:
path: cypress/screenshots
workflows:
version: 2
on-commit:
jobs:
- main:
filters:
branches:
ignore: gh-pages
- main@node-latest:
filters:
branches:
ignore: gh-pages
- integration@node-latest:
filters:
branches:
ignore: gh-pages
- frontend:
filters:
branches:
ignore: gh-pages
- services:
filters:
branches:
ignore:
- master
- gh-pages
- services@node-latest:
filters:
branches:
ignore:
- master
- gh-pages
- danger:
filters:
branches:
ignore:
- master
- gh-pages
- /dependabot\/.*/
- e2e:
filters:
branches:
ignore: gh-pages
# on-commit-with-cache:
# jobs:
# - npm-install:
# filters:
# branches:
# ignore: gh-pages
# - main:
# requires:
# - npm-install
# - main@node-latest:
# requires:
# - npm-install
# - frontend:
# requires:
# - npm-install
# - services:
# requires:
# - npm-install
# filters:
# branches:
# ignore: master
# - services@node-latest:
# requires:
# - npm-install
# filters:
# branches:
# ignore: master
# - danger:
# requires:
# - npm-install
# filters:
# branches:
# ignore: /dependabot\/.*/