diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a38f340..ea2c087d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,12 +69,27 @@ jobs: release_rc: <<: *defaults steps: - - attach_workspace: - at: ~/repo + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }}-{{checksum "package-lock.json"}} - run: sudo npm install -g npm - run: npm ci + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }}-{{checksum "package-lock.json"}} + + - run: + name: run tests incl coverage + command: npm run test + - run: npm run lint + - run: npm run build + - run: name: git config command: | @@ -82,7 +97,6 @@ jobs: git config user.email "no-reply@civic.com" git config user.name "CI Deployer" git config --global push.default simple - git branch --set-upstream-to origin/master - run: name: version diff --git a/package.json b/package.json index 7e91daa0..693d5f2a 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "build:browser:clean": "rimraf dist/prebrowser", "build:browser": "npm run build:browser:before && npm run build:browser:after && npm run build:browser:clean", "build": "npm run build:browser && npm run build:cjs && npm run build:es", - "postversion": "git add --all && git commit -m\"build and version $npm_package_version\" -m\"[skip ci]\" && git push", + "postversion": "git checkout master && git add --all && git commit -m\"build and version $npm_package_version\" -m\"[skip ci]\" && git push origin master", "pretag": "git fetch --tags", - "tag": "git tag v$npm_package_version && git push origin --tags", + "tag": "git tag v$npm_package_version && git push --tags origin master", "precommit": "npm run lint" }, "devDependencies": {