Update circle-ci config to test the project against a third node version (#3787)

* Update circle-ci config to test the project against a third (experimental) node version

* disable webext test on node 16

* fmt

* fix npm link

* Revert "disable webext test on node 16"

This reverts commit 8c2153d947.
This commit is contained in:
William Durand 2021-07-08 12:13:47 +02:00 коммит произвёл GitHub
Родитель 8f93edeb2d
Коммит 1035c113ce
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 43 добавлений и 6 удалений

Просмотреть файл

@ -17,11 +17,19 @@ references:
CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>> CIRCLE_COMPARE_URL: << pipeline.project.git_url >>/compare/<< pipeline.git.base_revision >>..<<pipeline.git.revision>>
defaults-next: &defaults-next defaults-next: &defaults-next
working_directory: ~/addons-linter <<: *defaults
docker: docker:
# This is the next NodeJS version we will support. # This is the next NodeJS version we will support.
- image: circleci/node:14 - image: circleci/node:14
defaults-alternate: &defaults-alternate
<<: *defaults
docker:
# This is an alternate Node version we support or want to support in the
# (far) future. It can either be lower or higher than the current Node
# version we run in production.
- image: circleci/node:16
restore_build_cache: &restore_build_cache restore_build_cache: &restore_build_cache
restore_cache: restore_cache:
name: restore npm package cache name: restore npm package cache
@ -69,6 +77,19 @@ references:
paths: paths:
- ./node_modules - ./node_modules
restore_alternate_build_cache: &restore_alternate_build_cache
restore_cache:
name: restore npm package cache
keys:
- alternate-npm-packages-{{ checksum "package-lock.json" }}
save_alternate_build_cache: &save_alternate_build_cache
save_cache:
name: save npm package cache
key: alternate-npm-packages-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
jobs: jobs:
test: test:
<<: *defaults <<: *defaults
@ -111,6 +132,21 @@ jobs:
- run: npm run test-integration:production - run: npm run test-integration:production
- run: npm run webext-test-functional - run: npm run webext-test-functional
test-alternate:
<<: *defaults-alternate
steps:
- checkout
- *restore_alternate_build_cache
- *run_npm_install
- *save_alternate_build_cache
- *make_production_build
- *configure_global_npm
- run: npm run test-ci
# run integration tests using an addons-linter binary in a
# production-like environment
- run: npm run test-integration:production
- run: npm run webext-test-functional
publish-rules: publish-rules:
<<: *defaults <<: *defaults
steps: steps:
@ -140,6 +176,7 @@ workflows:
tags: tags:
only: /.*/ only: /.*/
- test-next - test-next
- test-alternate
- publish-rules: - publish-rules:
requires: requires:
- test - test

Просмотреть файл

@ -4,17 +4,17 @@
npm install npm install
npm run build npm run build
# Create (global) addons-linter link LINTER_PATH=`pwd`
# See: https://docs.npmjs.com/cli/link
npm link
# Fetch web-ext # Fetch web-ext
git clone https://github.com/mozilla/web-ext git clone https://github.com/mozilla/web-ext
cd web-ext cd web-ext
# Link addons-linter, then install web-ext's dependencies # install web-ext's dependencies, then link the addons-linter
# dependency from the local addons-linter repo clone.
npm install npm install
npm link addons-linter mv node_modules/addons-linter node_modules/addons-linter.npm
ln -s $LINTER_PATH node_modules/addons-linter
# Run web-ext functional tests # Run web-ext functional tests
MOCHA_TIMEOUT=60000 npm run test-functional MOCHA_TIMEOUT=60000 npm run test-functional