-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
620 changed files
with
9,507 additions
and
4,791 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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
orbs: | ||
win: circleci/windows@1.0.0 | ||
win: circleci/windows@2.2.0 | ||
slack: circleci/[email protected] | ||
|
||
executors: | ||
node: | ||
parameters: | ||
image: | ||
type: string | ||
# First 10.x LTS release, but old Yarn | ||
default: "10.13" | ||
docker: | ||
- image: circleci/node:<< parameters.image >> | ||
node_10_19: | ||
parameters: | ||
image: | ||
type: string | ||
# More recent Yarn binary | ||
default: "10.19" | ||
docker: | ||
- image: circleci/node:<< parameters.image >> | ||
|
||
aliases: | ||
e2e-executor: &e2e-executor | ||
|
@@ -53,12 +62,12 @@ aliases: | |
|
||
test_template: &test_template | ||
steps: | ||
- checkout | ||
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*" | ||
- <<: *attach_to_bootstrap | ||
- <<: *install_node_modules | ||
- run: yarn list react | ||
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*" | ||
- run: node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci | ||
- run: GATSBY_DB_NODES=loki node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci | ||
# - run: GATSBY_DB_NODES=loki node --max-old-space-size=2048 ./node_modules/.bin/jest -w 1 --ci | ||
|
||
e2e-test-workflow: &e2e-test-workflow | ||
filters: | ||
|
@@ -69,6 +78,7 @@ aliases: | |
- /blog.+/ | ||
requires: | ||
- lint | ||
- typecheck | ||
- unit_tests_node10 | ||
|
||
e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias | ||
|
@@ -147,7 +157,7 @@ commands: | |
type: boolean | ||
default: false | ||
steps: | ||
- <<: *attach_to_bootstrap | ||
- checkout | ||
# In case of failure, add these steps again. Cache probably got deleted | ||
#- <<: *restore_cache | ||
#- <<: *install_node_modules | ||
|
@@ -156,6 +166,8 @@ commands: | |
condition: << parameters.skip_file_change_test >> | ||
steps: | ||
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*" | ||
|
||
- <<: *attach_to_bootstrap | ||
- run: | ||
name: Run tests (using defaults) | ||
command: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>" | ||
|
@@ -175,16 +187,10 @@ jobs: | |
executor: node | ||
steps: | ||
- checkout | ||
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*" | ||
- <<: *restore_cache | ||
- <<: *install_node_modules | ||
- <<: *persist_cache | ||
# persist our git checkout and node_modules as the next step (assert-changed-files) might exit this step | ||
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node10 | ||
- persist_to_workspace: | ||
root: ./ | ||
paths: | ||
- "*" | ||
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*" | ||
- run: yarn bootstrap -- concurrency=2 | ||
# Persist the workspace again with all packages already built | ||
- persist_to_workspace: | ||
|
@@ -194,12 +200,25 @@ jobs: | |
|
||
lint: | ||
executor: node | ||
parallelism: 2 | ||
steps: | ||
- <<: *attach_to_bootstrap | ||
- checkout | ||
# installation of dependencies takes a while because of the 100 packages we have inside the monorepo | ||
# Linting only needs the root packages, we remove the workspace and only install root packages | ||
- run: | ||
name: "remove workspaces from package.json" | ||
command: | | ||
sed -i ':a;N;$!ba;s/,\n\s*"workspaces":\s\[[^]]*]//g' package.json | ||
- <<: *install_node_modules | ||
- run: yarn lint:code | ||
- run: yarn lint:docs | ||
- run: yarn lint:other | ||
|
||
typecheck: | ||
executor: node | ||
steps: | ||
- checkout | ||
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*" | ||
- <<: *attach_to_bootstrap | ||
- run: yarn typecheck | ||
- run: yarn check-repo-fields | ||
|
||
|
@@ -230,12 +249,12 @@ jobs: | |
- e2e-test: | ||
test_path: integration-tests/long-term-caching | ||
|
||
integration_tests_cache_resilience: | ||
executor: node | ||
steps: | ||
- e2e-test: | ||
test_path: integration-tests/cache-resilience | ||
run_loki: true | ||
# integration_tests_cache_resilience: | ||
# executor: node | ||
# steps: | ||
# - e2e-test: | ||
# test_path: integration-tests/cache-resilience | ||
# run_loki: true | ||
|
||
integration_tests_gatsby_pipeline: | ||
executor: node | ||
|
@@ -247,10 +266,11 @@ jobs: | |
<<: *e2e-executor | ||
executor: node | ||
steps: | ||
- <<: *attach_to_bootstrap | ||
- checkout | ||
- run: | ||
name: Assert Changed Files | ||
command: ./scripts/assert-changed-files.sh "packages/gatsby-cli/*|packages/gatsby/*|integration-tests/gatsby-cli/*" | ||
- <<: *attach_to_bootstrap | ||
- run: | ||
name: Run tests (using defaults) | ||
command: cd integration-tests/gatsby-cli && yarn && yarn test | ||
|
@@ -270,6 +290,40 @@ jobs: | |
- e2e-test: | ||
test_path: e2e-tests/path-prefix | ||
|
||
e2e_tests_pnp: | ||
executor: node_10_19 | ||
steps: | ||
- checkout | ||
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*" | ||
- <<: *attach_to_bootstrap | ||
- run: | ||
command: cp -r ./starters/default ./e2e-tests/gatsby-pnp | ||
working_directory: ~/project | ||
- run: | ||
command: touch yarn.lock | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: # Quick upgrade to the v2 (any version, we just need the real set version) | ||
command: yarn policies set-version berry | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: # Pins the Yarn version | ||
command: yarn set version 2.0.0-rc.32 | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: # Forces to use the local packages | ||
command: yarn link --all --private ../.. | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: | ||
command: yarn install | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: | ||
command: yarn add start-server-and-test@^1.11.0 | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: | ||
command: yarn build | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
- run: | ||
command: 'DEBUG=start-server-and-test yarn start-server-and-test "yarn develop 2>&1 | tee log.txt" :8000 "! cat log.txt | grep ''ERROR #''"' | ||
working_directory: ~/project/e2e-tests/gatsby-pnp | ||
|
||
e2e_tests_gatsby-image: | ||
<<: *e2e_tests_gatsby-image_alias | ||
|
||
|
@@ -327,7 +381,9 @@ jobs: | |
starters_publish: | ||
executor: node | ||
steps: | ||
- <<: *attach_to_bootstrap | ||
- checkout | ||
- <<: *restore_cache | ||
- <<: *install_node_modules | ||
- run: yarn markdown | ||
- run: sudo apt-get update && sudo apt-get install jq # jq is helpful for parsing json | ||
- run: git config --global user.name "GatsbyJS Bot" | ||
|
@@ -362,21 +418,27 @@ jobs: | |
|
||
windows_unit_tests: | ||
executor: | ||
name: win/vs2019 | ||
name: win/default | ||
shell: powershell.exe | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- yarn-packages-v2-{{ checksum "yarn.lock" }} | ||
- yarn-packages-v2- | ||
# Restoring cache takes as long as installing node modules, so skipping | ||
# - restore_cache: | ||
# keys: | ||
# - yarn-packages-v2-{{ checksum "yarn.lock" }} | ||
# - yarn-packages-v2- | ||
- run: | ||
name: "Install dependencies" | ||
command: yarn bootstrap | ||
- save_cache: | ||
paths: | ||
- C:\Users\circleci\AppData\Local\Yarn\Cache | ||
key: yarn-packages-v2-{{ checksum "yarn.lock" }} | ||
name: Install node modules | ||
command: yarn --frozen-lockfile | ||
# Caching is slow, so disabling | ||
# - save_cache: | ||
# paths: | ||
# - C:\Users\circleci\AppData\Local\Yarn\Cache | ||
# key: yarn-packages-v2-{{ checksum "yarn.lock" }} | ||
- run: | ||
command: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*" | ||
shell: bash.exe | ||
- run: yarn npm-run-all -s check-versions "lerna-prepare --concurrency=4 --stream" | ||
- run: | ||
name: "Run Tests" | ||
command: yarn jest -w 1 --ci | ||
|
@@ -464,36 +526,44 @@ workflows: | |
build-test: | ||
jobs: | ||
- bootstrap | ||
- lint | ||
- typecheck: | ||
requires: | ||
- bootstrap | ||
- windows_unit_tests: | ||
<<: *ignore_docs | ||
- lint: | ||
requires: | ||
- bootstrap | ||
- lint | ||
- unit_tests_node10: | ||
<<: *ignore_docs | ||
requires: | ||
- lint | ||
- typecheck | ||
- bootstrap | ||
- unit_tests_node12: | ||
<<: *ignore_docs | ||
requires: | ||
- lint | ||
- typecheck | ||
- bootstrap | ||
- unit_tests_www: | ||
requires: | ||
- lint | ||
- typecheck | ||
- bootstrap | ||
- integration_tests_long_term_caching: | ||
<<: *e2e-test-workflow | ||
- integration_tests_cache_resilience: | ||
<<: *e2e-test-workflow | ||
# - integration_tests_cache_resilience: | ||
# <<: *e2e-test-workflow | ||
- integration_tests_gatsby_pipeline: | ||
<<: *e2e-test-workflow | ||
- integration_tests_structured_logging: | ||
<<: *e2e-test-workflow | ||
- integration_tests_gatsby_cli: | ||
requires: | ||
- bootstrap | ||
- e2e_tests_pnp: | ||
<<: *e2e-test-workflow | ||
- e2e_tests_path-prefix: | ||
<<: *e2e-test-workflow | ||
- e2e_tests_gatsby-image: | ||
|
@@ -509,8 +579,6 @@ workflows: | |
- starters_validate: | ||
<<: *ignore_master | ||
- starters_publish: | ||
requires: | ||
- bootstrap | ||
filters: | ||
branches: | ||
only: | ||
|
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 |
---|---|---|
|
@@ -35,6 +35,7 @@ jobs: | |
Thanks again for being part of the Gatsby community! 💪💜 | ||
EXEMPT_ISSUE_LABELS: | | ||
not stale | ||
status: triage needed | ||
- name: Post slack report | ||
uses: pullreminders/[email protected] | ||
env: | ||
|
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 |
---|---|---|
|
@@ -39,6 +39,7 @@ test/**/public | |
.DS_Store | ||
public/ | ||
node_modules/ | ||
e2e-tests/gatsby-pnp/ | ||
.cache/ | ||
.netlify | ||
|
||
|
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,39 @@ | ||
module.exports = { | ||
plugins: [ | ||
["remark-frontmatter", "yaml"], | ||
"remark-preset-lint-recommended", | ||
"remark-preset-lint-markdown-style-guide", | ||
|
||
// additional remark-lint rules | ||
["remark-lint-list-item-indent", "space"], | ||
"remark-lint-no-duplicate-headings-in-section", | ||
"remark-lint-no-reference-like-url", | ||
["remark-lint-ordered-list-marker-value", "ordered"], | ||
|
||
// We would like these rules to be enabled, but they require significant content changes | ||
// and need additional PRs to be implemented | ||
["remark-lint-emphasis-marker", false], | ||
["remark-lint-heading-increment", false], | ||
["remark-lint-no-heading-punctuation", false], | ||
["remark-lint-list-item-spacing", false], | ||
|
||
// The following rules are disabled because they are inconsistent to the | ||
// Gatsby Style Guide. | ||
|
||
// We use soft-wrapped paragraphs for ease of diffing/translation. | ||
["remark-lint-maximum-line-length", false], | ||
// We don't restrict the length of headings. | ||
["remark-lint-maximum-heading-length", false], | ||
// We use duplicate headings sometimes, e.g. multiple "Directions" in Recipes. | ||
// Use no-duplicate-headings-in-section instead. | ||
["remark-lint-no-duplicate-headings", false], | ||
// We use emphasis as notes or warnings in a couple places, which triggers this rule. | ||
["remark-lint-no-emphasis-as-heading", false], | ||
// YouTube and Giphy embeds in the docs use literal URLs. | ||
["remark-lint-no-literal-urls", false], | ||
// We use `[shortcuts]` for convenience. | ||
["remark-lint-no-shortcut-reference-link", false], | ||
// We use brackets in a lot of places as argument lists and do not want to escape them. | ||
["remark-lint-no-undefined-references", false], | ||
], | ||
} |
Validating CODEOWNERS rules …
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
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
Oops, something went wrong.