Skip to content

Commit

Permalink
ci(travis): update ci/cd script
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Aug 4, 2021
1 parent 158a85e commit 91bfb8f
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 29 deletions.
90 changes: 64 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,69 @@
dist: xenial
language: node_js
node_js:
- '16'
node_js: 16
install: skip
cache: yarn

cache:
directories:
- node_modules
os: linux
dist: focal

before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
jobs:
fast_finish: true
include:
- stage: verify
if: branch != master AND type != pull_request
install:
- yarn
- yarn bootstrap
script:
- yarn build
- if [ "$CI_TEST" != "false" ]; then
yarn test;
fi
- if: branch = master
stage: build
install:
- yarn
- yarn bootstrap
script:
- yarn build
# https://docs.travis-ci.com/user/using-workspaces/
workspaces:
create:
name: linux-shared
paths:
- node_modules
- packages

after_script:
- ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
- &test
if: branch = master AND type = pull_request AND env(CI_TEST) != false
stage: test
script: yarn test
workspaces:
use: linux-shared
- <<: *test
node_js: 14
- <<: *test
if: branch = master AND type != pull_request AND env(CI_TEST) != false
before_script:
- if [ "$CC_TEST_REPORTER_ID" != "" ]; then
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter;
chmod +x ./cc-test-reporter;
./cc-test-reporter before-build;
fi
script:
- if [ "$CC_TEST_REPORTER_ID" != "" ]; then
yarn test:report;
else
yarn test;
fi
after_script:
- if [ "$CC_TEST_REPORTER_ID" != "" ]; then
./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info;
./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT;
fi

install:
- yarn
- yarn run bootstrap
- yarn run build

script:
- yarn test:report

deploy:
provider: script
skip_cleanup: true
script:
- npx -p @qiwi/semrel-toolkit multi-semrel
- stage: release
if: branch = master AND type != pull_request AND env(CI_RELEASE) = true
workspaces:
use: linux-shared
script: npx -p @qiwi/semrel-toolkit multi-semrel
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"prebuild": "tsc -b packages/facade/tsconfig.es5.json",
"build": "yarn clean && yarn prebuild && lerna run build --stream --concurrency 2",
"bootstrap": "lerna bootstrap",
"jest": "jest",
"test:report": "yarn test && yarn coveralls:push",
"lint": "lerna run lint --concurrency 2 --stream",
"test:unit": "jest",
"test": "yarn lint && yarn test:unit",
"//test": "lerna run test --concurrency 1 --stream --no-prefix && yarn coverage:merge",
"test": "lerna run lint --concurrency 2 --stream && yarn jest",
"test:report": "yarn test && yarn coveralls:push",
"coverage:merge": "node scripts/js/coverage-merge.js",
"codeclimate:push": "codeclimate-test-reporter < ./coverage/lcov.info",
"coveralls:push": "cat ./coverage/lcov.info | coveralls || echo 'coveralls push failed :(' && exit 0",
Expand Down

0 comments on commit 91bfb8f

Please sign in to comment.