Merge pull request #6474 from BryceLTaylor/CircleCi-remove-caches

circle remove having separate jobs and caching
This commit is contained in:
Bryce Taylor 2022-02-01 15:04:15 -05:00 committed by GitHub
commit 77d3dafed5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,92 +8,74 @@ aliases:
username: $DOCKERHUB_USERNAME username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD password: $DOCKERHUB_PASSWORD
working_directory: ~/repo working_directory: ~/repo
- &save_git_cache - &setup
save_cache: name: "setup"
paths: command: |
- .git npm --production=false ci
key: v1-git-{{ .Revision }} mkdir ./test/results
- &restore_git_cache - &lint
restore_cache: name: "run lint tests"
keys: command: |
- v1-git-{{ .Revision }} npm run test:lint:ci
- v1-git- - &build
- &save_npm_cache name: "run npm build"
save_cache: command: |
paths: WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
- node_modules - &unit
key: v1-npm-{{ checksum "package-lock.json" }} name: "Run unit tests"
- &restore_npm_cache command: |
restore_cache: JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run test:unit:jest:unit -- --reporters=jest-junit
keys: JEST_JUNIT_OUTPUT_NAME=localization-jest-results.xml npm run test:unit:jest:localization -- --reporters=jest-junit
- v1-npm-{{ checksum "package-lock.json" }} npm run test:unit:tap -- --output-file ./test/results/unit-raw.tap
- &save_build_cache npm run test:unit:convertReportToXunit
save_cache: - &setup_python
paths: name: "setup python"
- ./build command: |
- ./intl curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py
key: v1-build-{{ .Revision }} python3 get-pip.py pip==21.0.1
- &restore_build_cache pip install s3cmd==2.1.0
restore_cache: - &deploy
keys: name: "deploy"
- v1-build-{{ .Revision }} command: |
- v1-build- npm run deploy
- &build_no_cache - &integration
name: "integration tests with Jest"
command: |
JEST_JUNIT_OUTPUT_NAME=integration-jest-results.xml npm run test:integration:remote -- --reporters=jest-junit
- &build_no_deploy
<<: *defaults <<: *defaults
resource_class: large resource_class: large
steps: steps:
- checkout - checkout
- run: - run:
name: "setup" <<: *setup
command: |
npm --production=false ci
mkdir ./test/results
- run: - run:
name: "run lint tests" <<: *lint
command: |
npm run test:lint:ci
- run: - run:
name: "run npm build" <<: *build
command: |
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
- run: - run:
name: "Run unit tests" <<: *unit
command: |
JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run test:unit:jest:unit -- --reporters=jest-junit
JEST_JUNIT_OUTPUT_NAME=localization-jest-results.xml npm run test:unit:jest:localization -- --reporters=jest-junit
npm run test:unit:tap -- --output-file ./test/results/unit-raw.tap
npm run test:unit:convertReportToXunit
- store_test_results: - store_test_results:
path: test/results path: test/results
- &build - &build_and_deploy
<<: *defaults <<: *defaults
resource_class: large resource_class: large
steps: steps:
- *restore_git_cache
- checkout - checkout
- run: - run:
name: "setup" <<: *setup
command: |
npm --production=false ci
mkdir ./test/results
- run: - run:
name: "run lint tests" <<: *lint
command: |
npm run test:lint:ci
- run: - run:
name: "run npm build" <<: *build
command: |
WWW_VERSION=${CIRCLE_SHA1:0:5} npm run build
- run: - run:
name: "Run unit tests" <<: *unit
command: | - run:
JEST_JUNIT_OUTPUT_NAME=unit-jest-results.xml npm run test:unit:jest:unit -- --reporters=jest-junit <<: *setup_python
JEST_JUNIT_OUTPUT_NAME=localization-jest-results.xml npm run test:unit:jest:localization -- --reporters=jest-junit - run:
npm run test:unit:tap -- --output-file ./test/results/unit-raw.tap <<: *deploy
npm run test:unit:convertReportToXunit - run:
- *save_npm_cache <<: *integration
- *save_git_cache
- *save_build_cache
- store_test_results: - store_test_results:
path: test/results path: test/results
- run: - run:
@ -101,35 +83,6 @@ aliases:
command: tar -cvzf build.tar build command: tar -cvzf build.tar build
- store_artifacts: - store_artifacts:
path: build.tar path: build.tar
- &deploy
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- *restore_build_cache
- run:
name: "setup python"
command: |
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py -o get-pip.py
python3 get-pip.py pip==21.0.1
pip install s3cmd==2.1.0
- run:
name: "deploy"
command: |
npm run deploy
- &integration_jest
<<: *defaults
steps:
- *restore_git_cache
- checkout
- *restore_npm_cache
- run:
name: "integration tests with Jest"
command: |
JEST_JUNIT_OUTPUT_NAME=integration-jest-results.xml npm run test:integration:remote -- --reporters=jest-junit
- store_test_results:
path: test/results
- &update-translations - &update-translations
<<: *defaults <<: *defaults
steps: steps:
@ -141,28 +94,21 @@ aliases:
name: "run i18n script" name: "run i18n script"
command: npm run i18n:push command: npm run i18n:push
# build-test-deploy requires two separately named jobs
jobs: jobs:
build-staging: build-and-deploy-staging:
<<: *build <<: *build_and_deploy
build-production: build-and-deploy-production:
<<: *build <<: *build_and_deploy
deploy-staging:
<<: *deploy
deploy-production:
<<: *deploy
integration-staging-jest:
<<: *integration_jest
integration-production-jest:
<<: *integration_jest
update-translations: update-translations:
<<: *update-translations <<: *update-translations
build-no-cache: build-no-deploy:
<<: *build_no_cache <<: *build_no_deploy
workflows: workflows:
build-test-deploy: build-test-deploy:
jobs: jobs:
- build-staging: - build-and-deploy-staging:
context: context:
- scratch-www-all - scratch-www-all
- scratch-www-staging - scratch-www-staging
@ -172,7 +118,7 @@ workflows:
- develop - develop
- /^hotfix\/.*/ - /^hotfix\/.*/
- /^release\/.*/ - /^release\/.*/
- build-production: - build-and-deploy-production:
context: context:
- scratch-www-all - scratch-www-all
- scratch-www-production - scratch-www-production
@ -180,50 +126,6 @@ workflows:
branches: branches:
only: only:
- master - master
- deploy-staging:
context:
- scratch-www-all
- scratch-www-staging
requires:
- build-staging
filters:
branches:
only:
- develop
- /^hotfix\/.*/
- /^release\/.*/
- deploy-production:
context:
- scratch-www-all
- scratch-www-production
requires:
- build-production
filters:
branches:
only:
- master
- integration-staging-jest:
context:
- scratch-www-all
- scratch-www-staging
requires:
- deploy-staging
filters:
branches:
only:
- develop
- /^hotfix\/.*/
- /^release\/.*/
- integration-production-jest:
context:
- scratch-www-all
- scratch-www-production
requires:
- deploy-production
filters:
branches:
only:
- master
Update-translations: Update-translations:
triggers: triggers:
- schedule: # every evening at 7pm EST (8pm EDT, Midnight UTC) - schedule: # every evening at 7pm EST (8pm EDT, Midnight UTC)
@ -242,7 +144,7 @@ workflows:
- develop - develop
build-test-no-deploy: build-test-no-deploy:
jobs: jobs:
- build-no-cache: - build-no-deploy:
filters: filters:
branches: branches:
ignore: ignore: