-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…integration-and-testing Continuous Integration & Testing
- Loading branch information
Showing
9 changed files
with
205 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# Copyright (C) 2018-present Arctic Ice Studio <[email protected]> | ||
# Copyright (C) 2018-present Sven Greb <[email protected]> | ||
# | ||
# Project: Nord Docs | ||
# Repository: https://github.com/arcticicestudio/nord-docs | ||
# License: MIT | ||
|
||
# Configuration for Circle CI. | ||
# | ||
# References: | ||
# - https://circleci.com/docs/2.0 | ||
# - https://circleci.com/docs/2.0/circleci-images | ||
# - https://circleci.com/docs/2.0/contexts | ||
|
||
version: 2.1 | ||
|
||
commands: | ||
build: | ||
description: "Build a production bundle with Gatsby" | ||
steps: | ||
- run: | ||
name: Build production bundle | ||
command: npm run build:gatsby | ||
post-process: | ||
description: "Post-process the build" | ||
steps: | ||
- save-npm-cache | ||
- store_artifacts: | ||
path: ./build/reports | ||
- store_artifacts: | ||
path: ./public | ||
- store_artifacts: | ||
path: ./node_modules.tgz | ||
- store_test_results: | ||
path: ./build/reports/junit | ||
- codecov/upload: | ||
file: ./build/reports/coverage/coverage-final.json | ||
flags: unit | ||
pre-process: | ||
description: "Pre-process the build" | ||
steps: | ||
- checkout | ||
- print-env-info | ||
- restore-npm-cache | ||
- run: | ||
name: Install dependencies | ||
command: npm ci | ||
print-env-info: | ||
description: "Print build & environment information" | ||
steps: | ||
- run: | ||
name: NPM and NodeJS Version Information | ||
command: npm version | ||
- run: | ||
name: OS Information | ||
command: uname -a | ||
- run: | ||
name: Git and Build Metadata | ||
command: | | ||
echo $CIRCLE_COMPARE_URL | cut -d/ -f7 | ||
echo "Git branch: $CIRCLE_BRANCH" | ||
echo "Git commit: $CIRCLE_SHA1" | ||
echo "Job: $CIRCLE_JOB" | ||
echo "Build: $CIRCLE_BUILD_NUM" | ||
restore-npm-cache: | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-npm-cache--{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }} | ||
- v1-npm-cache--{{ arch }}-{{ .Branch }} | ||
- v1-npm-cache--{{ arch }} | ||
save-npm-cache: | ||
steps: | ||
- save_cache: | ||
key: v1-npm-cache--{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }} | ||
paths: | ||
- node_modules | ||
test: | ||
steps: | ||
- run: | ||
name: Lint | ||
command: npm run lint | ||
- run: | ||
name: Run tests with coverage in CI mode | ||
command: npm run test:ci | ||
|
||
jobs: | ||
nodejs-v8: | ||
docker: | ||
- image: node:8 | ||
steps: | ||
- pre-process | ||
- test | ||
- build | ||
- post-process | ||
nodejs-v10: | ||
docker: | ||
- image: node:10 | ||
steps: | ||
- pre-process | ||
- test | ||
- build | ||
- post-process | ||
nodejs-latest: | ||
docker: | ||
- image: node:latest | ||
steps: | ||
- pre-process | ||
- test | ||
- build | ||
- post-process | ||
|
||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
workflows: | ||
version: 2.1 | ||
build-multi-version: | ||
jobs: | ||
- nodejs-v8: | ||
context: nord-docs-ctx | ||
- nodejs-v10: | ||
context: nord-docs-ctx | ||
- nodejs-latest: | ||
context: nord-docs-ctx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (C) 2018-present Arctic Ice Studio <[email protected]> | ||
# Copyright (C) 2018-present Sven Greb <[email protected]> | ||
# | ||
# Project: Nord Docs | ||
# Repository: https://github.com/arcticicestudio/nord-docs | ||
# License: MIT | ||
|
||
# Configuration for Codecov. | ||
# | ||
# References: | ||
# - https://docs.codecov.io/docs/codecov-yaml | ||
# - https://docs.codecov.io/docs/node | ||
|
||
codecov: | ||
branch: develop | ||
|
||
parsers: | ||
javascript: | ||
enable_partials: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A stub to prevent the "gatsby-source-filesystem" plugin to error on CI builds when this folder doesn't exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A stub to prevent the "gatsby-source-filesystem" plugin to error on CI builds when this folder doesn't exist. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,11 @@ | |
* @author Sven Greb <[email protected]> | ||
* @see https://jestjs.io/docs/en/configuration | ||
* @see https://www.gatsbyjs.org/docs/testing | ||
* @see https://circleci.com/docs/2.0/collect-test-data/#jest | ||
* @since 0.1.0 | ||
*/ | ||
|
||
const { BASE_DIR_BUILD_REPORTS_COVERAGE } = require("./src/config/internal/constants"); | ||
const { BASE_DIR_BUILD_REPORTS_COVERAGE, BASE_DIR_BUILD_REPORTS_JUNIT } = require("./src/config/internal/constants"); | ||
|
||
module.exports = { | ||
/* | ||
|
@@ -70,6 +71,20 @@ module.exports = { | |
*/ | ||
modulePaths: ["<rootDir>/test/__utils__"], | ||
|
||
/* | ||
* An array of module names to specify which reporters will be used. | ||
*/ | ||
reporters: [ | ||
"default", | ||
[ | ||
"jest-junit", | ||
{ | ||
outputDirectory: `${BASE_DIR_BUILD_REPORTS_JUNIT}`, | ||
outputName: "jest.xml" | ||
} | ||
] | ||
], | ||
|
||
/* | ||
* The paths to modules that run some code to configure or set up the testing environment before each test. | ||
* The `___loader` shim is a global function used by internal Gatsby APIs. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
A stub to prevent the "gatsby-source-filesystem" plugin to error on CI builds when this folder doesn't exist. |
Oops, something went wrong.