Skip to content

Commit

Permalink
Merge branch 'master' into node12-deprecation-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EnKrypt committed Jan 6, 2020
2 parents 44ed0ce + 04e801f commit 18f5457
Show file tree
Hide file tree
Showing 1,297 changed files with 68,853 additions and 59,164 deletions.
6 changes: 6 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ if (process.env.NODE_ENV !== `test`) {
module.exports = {
sourceMaps: true,
presets: ["babel-preset-gatsby-package"],
overrides: [
{
test: "**/*.ts",
plugins: [["@babel/plugin-transform-typescript", { isTSX: true }]],
},
],
ignore,
}
244 changes: 199 additions & 45 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
orbs:
win: circleci/windows@1.0.0
slack: circleci/slack@3.4.1

executors:
node:
Expand Down Expand Up @@ -35,7 +36,7 @@ aliases:

attach_to_bootstrap: &attach_to_bootstrap
attach_workspace:
at: packages
at: ./

ignore_master: &ignore_master
filters:
Expand All @@ -52,12 +53,10 @@ aliases:

test_template: &test_template
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- <<: *restore_cache
- <<: *install_node_modules
- <<: *persist_cache
- <<: *attach_to_bootstrap
- <<: *install_node_modules
- run: yarn list react
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- run: yarn jest -w 1 --ci
- run: GATSBY_DB_NODES=loki yarn jest -w 1 --ci

Expand All @@ -72,9 +71,70 @@ aliases:
- lint
- unit_tests_node8

e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
<<: *e2e-executor
parameters:
nightly:
type: boolean
default: false
steps:
- e2e-test:
test_path: e2e-tests/production-runtime
test_command: CYPRESS_PROJECT_ID=is8aoq CYPRESS_RECORD_KEY=cb4708d2-1578-4665-9a07-c59f8db28d91 yarn test && CYPRESS_PROJECT_ID=htpvkv CYPRESS_RECORD_KEY=0d734841-c613-41d2-86e5-df0b5968f93f yarn test:offline
skip_file_change_test: << parameters.nightly >>
- notify-status:
condition: << parameters.nightly >>

e2e_tests_development_runtime_alias: &e2e_tests_development_runtime_alias
<<: *e2e-executor
parameters:
nightly:
type: boolean
default: false
environment:
CYPRESS_PROJECT_ID: s3j3qj
CYPRESS_RECORD_KEY: 3904ca0c-bc98-47d9-8371-b68c5e81fb9b
steps:
- e2e-test:
test_path: e2e-tests/development-runtime
skip_file_change_test: << parameters.nightly >>
- notify-status:
condition: << parameters.nightly >>

e2e_tests_gatsby-image_alias: &e2e_tests_gatsby-image_alias
<<: *e2e-executor
parameters:
nightly:
type: boolean
default: false
environment:
CYPRESS_PROJECT_ID: ave32k
CYPRESS_RECORD_KEY: fb3cb6e0-a0f9-48b2-aa9a-95e8ef150a85
steps:
- e2e-test:
test_path: e2e-tests/gatsby-image
skip_file_change_test: << parameters.nightly >>
- notify-status:
condition: << parameters.nightly >>

commands:
notify-status:
parameters:
condition:
type: boolean
default: false
steps:
- when:
condition: << parameters.condition >>
steps:
- slack/status:
channel: eng-react-integration-status

e2e-test:
parameters:
skip_file_change_test:
type: boolean
default: false
trigger_pattern:
type: string
default: "packages/*|.circleci/*"
Expand All @@ -84,12 +144,15 @@ commands:
type: string
default: "" # if unset, e2e-test.sh specifies the command
steps:
- checkout
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
- <<: *restore_cache
- <<: *install_node_modules
- <<: *persist_cache
- <<: *attach_to_bootstrap
# In case of failure, add these steps again. Cache probably got deleted
#- <<: *restore_cache
#- <<: *install_node_modules
#- <<: *persist_cache
- unless:
condition: << parameters.skip_file_change_test >>
steps:
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
- run: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"

version: 2.1
Expand All @@ -99,26 +162,32 @@ 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_node8
- 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:
root: packages
root: ./
paths:
- "*"

lint:
executor: node
parallelism: 2
steps:
- checkout
- <<: *restore_cache
- <<: *install_node_modules
- <<: *persist_cache
- <<: *attach_to_bootstrap
- run: yarn lint:code
- run: yarn lint:other
- run: ./scripts/assert-changed-files.sh "packages/*|.circleci/*"
- run: yarn typecheck
- run: yarn check-repo-fields

unit_tests_node8:
Expand Down Expand Up @@ -176,29 +245,31 @@ jobs:
test_path: e2e-tests/path-prefix

e2e_tests_gatsby-image:
<<: *e2e-executor
environment:
CYPRESS_PROJECT_ID: ave32k
CYPRESS_RECORD_KEY: fb3cb6e0-a0f9-48b2-aa9a-95e8ef150a85
steps:
- e2e-test:
test_path: e2e-tests/gatsby-image
<<: *e2e_tests_gatsby-image_alias

e2e_tests_gatsby-image_with_experimental_react:
<<: *e2e_tests_gatsby-image_alias

e2e_tests_gatsby-image_with_next_react:
<<: *e2e_tests_gatsby-image_alias

e2e_tests_development_runtime:
<<: *e2e-executor
environment:
CYPRESS_PROJECT_ID: s3j3qj
CYPRESS_RECORD_KEY: 3904ca0c-bc98-47d9-8371-b68c5e81fb9b
steps:
- e2e-test:
test_path: e2e-tests/development-runtime
<<: *e2e_tests_development_runtime_alias

e2e_tests_development_runtime_with_experimental_react:
<<: *e2e_tests_development_runtime_alias

e2e_tests_development_runtime_with_next_react:
<<: *e2e_tests_development_runtime_alias

e2e_tests_production_runtime:
<<: *e2e-executor
steps:
- e2e-test:
test_path: e2e-tests/production-runtime
test_command: CYPRESS_PROJECT_ID=is8aoq CYPRESS_RECORD_KEY=cb4708d2-1578-4665-9a07-c59f8db28d91 yarn test && CYPRESS_PROJECT_ID=htpvkv CYPRESS_RECORD_KEY=0d734841-c613-41d2-86e5-df0b5968f93f yarn test:offline
<<: *e2e_tests_production_runtime_alias

e2e_tests_production_runtime_with_experimental_react:
<<: *e2e_tests_production_runtime_alias

e2e_tests_production_runtime_with_next_react:
<<: *e2e_tests_production_runtime_alias

themes_e2e_tests_development_runtime:
<<: *e2e-executor
Expand Down Expand Up @@ -230,26 +301,36 @@ jobs:
starters_publish:
executor: node
steps:
- checkout
- <<: *restore_cache
- <<: *install_node_modules
- <<: *persist_cache
- <<: *attach_to_bootstrap
- 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"
- run: git config --global user.email "core-team@gatsbyjs.com"
- run: sh ./scripts/publish-starters.sh "starters/*"

update_i18n_source:
executor: node
steps:
- checkout
- run: git config --global user.name "GatsbyJS Bot"
- run: git config --global user.email "core-team@gatsbyjs.com"
- run:
command: yarn
working_directory: ~/project/scripts/i18n
- run:
command: yarn run update-source
working_directory: ~/project/scripts/i18n

build_www:
docker:
- image: circleci/node:12
resource_class: xlarge # ++ RAM and CPU
steps:
- checkout
- restore_cache:
key: v1_www_public_dir
key: v2_www_public_dir
- restore_cache:
key: v1_www_cache_dir
key: v2_www_cache_dir
- run:
command: yarn
working_directory: ~/project/www
Expand All @@ -258,11 +339,11 @@ jobs:
command: GATSBY_CPU_COUNT=8 yarn build
working_directory: ~/project/www
- save_cache:
key: v1_www_public_dir_{{ epoch }}
key: v2_www_public_dir_{{ epoch }}
paths:
- ~/project/www/public
- save_cache:
key: v1_www_cache_dir_{{ epoch }}
key: v2_www_cache_dir_{{ epoch }}
paths:
- ~/project/www/.cache

Expand All @@ -272,7 +353,7 @@ jobs:
steps:
- checkout
- restore_cache:
key: v1_www_public_dir
key: v2_www_public_dir
- run:
command: yarn add netlify-cli
working_directory: ~/project/www
Expand Down Expand Up @@ -302,8 +383,74 @@ jobs:
name: "Run Tests"
command: yarn test

bootstrap-with-experimental-react:
executor: node
parameters:
version:
type: string
default: "next"
steps:
- checkout
- run:
name: "Update React to prerelease"
command: "REACT_CHANNEL=<< parameters.version >> node ./scripts/upgrade-react"
- run: yarn install
- run: yarn bootstrap -- concurrency=2
- run: yarn list react
- persist_to_workspace:
root: ./
paths:
- "*"

workflows:
version: 2
nightly-react-next:
triggers:
- schedule:
cron: "0 0 * * 1,2,3,4,5"
filters:
branches:
only:
- master
jobs:
- bootstrap-with-experimental-react:
version: "next"
- e2e_tests_gatsby-image_with_next_react:
nightly: true
requires:
- bootstrap-with-experimental-react
- e2e_tests_development_runtime_with_next_react:
nightly: true
requires:
- bootstrap-with-experimental-react
- e2e_tests_production_runtime_with_next_react:
nightly: true
requires:
- bootstrap-with-experimental-react
nightly-react-experimental:
triggers:
- schedule:
cron: "0 0 * * 1,2,3,4,5"
filters:
branches:
only:
- master
jobs:
- bootstrap-with-experimental-react:
version: "experimental"
- e2e_tests_gatsby-image_with_experimental_react:
nightly: true
requires:
- bootstrap-with-experimental-react
- e2e_tests_development_runtime_with_experimental_react:
nightly: true
requires:
- bootstrap-with-experimental-react
- e2e_tests_production_runtime_with_experimental_react:
nightly: true
requires:
- bootstrap-with-experimental-react

build-test:
jobs:
- windows_unit_tests
Expand Down Expand Up @@ -350,6 +497,8 @@ workflows:
- starters_validate:
<<: *ignore_master
- starters_publish:
requires:
- bootstrap
filters:
branches:
only:
Expand All @@ -368,6 +517,11 @@ workflows:
requires:
- build_www
context: build_www
- update_i18n_source:
filters:
branches:
only:
- master
www_deploy:
triggers:
- schedule:
Expand Down

0 comments on commit 18f5457

Please sign in to comment.