Skip to content

Commit

Permalink
add circle ci config (#54)
Browse files Browse the repository at this point in the history
* add circle ci config
* fix broken tests and linting
  • Loading branch information
Noviny authored May 29, 2019
1 parent 9a2e921 commit 8d2e700
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 103 deletions.
4 changes: 4 additions & 0 deletions .changeset/c5ab78fe/changes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"releases": [{ "name": "@changesets/cli", "type": "patch" }],
"dependents": []
}
1 change: 1 addition & 0 deletions .changeset/c5ab78fe/changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused function parseChangesetCommit
80 changes: 80 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
version: 2
jobs:
test:
docker:
- image: circleci/node:10.6.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install
command: yarn install --pure-lockfile
- run:
name: GitSetup
command: git config --global user.email "you@example.com" && git config --global user.name "Your Name"
- run:
name: "Jest Tests"
command: yarn jest --ci --runInBand --coverage --reporters=default --reporters=jest-junit
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- run:
name: "Upload Coverage"
command: yarn codecov
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
- save_cache:
paths:
- ~/.cache/yarn
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}

typescript:
docker:
- image: circleci/node:10.6.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install
command: yarn install --pure-lockfile
- run:
name: "Typescript"
command: yarn types:check

lint:
docker:
- image: circleci/node:10.6.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Install
command: yarn install --pure-lockfile
- run:
name: "ESLint"
command: yarn lint

workflows:
version: 2
test:
jobs:
- test
- lint
- typescript
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
dist
__fixtures__
node_modules
14 changes: 13 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
"standard/computed-property-even-spacing": "off",
"no-template-curly-in-string": "off",
"camelcase": "off",
"import/no-duplicates": "off"
"import/no-duplicates": "off",
"no-useless-constructor": "off",
"no-unusued-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
]
},
"overrides": [
{
Expand Down Expand Up @@ -40,6 +46,12 @@
"rules": {
"prefer-const": "off"
}
},
{
"files": ["packages/cli/default-files/config.js"],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@babel/preset-typescript": "^7.3.3",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"codecov": "^3.5.0",
"dotenv": "^8.0.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
Expand All @@ -67,6 +68,7 @@
"eslint-plugin-standard": "^4.0.0",
"jest": "^24.7.1",
"jest-fixtures": "^0.5.0",
"jest-junit": "^6.4.0",
"preconstruct": "^0.0.70"
},
"preconstruct": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add/__tests__/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const mockUserResponses = mockResponses => {
const summary = mockResponses.summary || "summary message mock";
const shouldCommit = mockResponses.shouldCommit || "n";
askCheckboxPlus.mockReturnValueOnce(Object.keys(mockResponses.releases));
Object.entries(mockResponses.releases).forEach(([pkg, type]) =>
Object.entries(mockResponses.releases).forEach(([_pkg, type]) =>
askList.mockReturnValueOnce(type)
);
askQuestion.mockReturnValueOnce(summary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const mockUserResponses = mockResponses => {
const summary = mockResponses.summary || "summary message mock";
const shouldCommit = mockResponses.shouldCommit || "n";
askCheckboxPlus.mockReturnValueOnce(Object.keys(mockResponses.releases));
Object.entries(mockResponses.releases).forEach(([pkg, type]) =>
Object.entries(mockResponses.releases).forEach(([_pkg, type]) =>
askList.mockReturnValueOnce(type)
);
askQuestion.mockReturnValueOnce(summary);
Expand Down

This file was deleted.

38 changes: 0 additions & 38 deletions packages/cli/src/commands/add/parseChangesetCommit.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/cli/src/commands/bump/__tests__/consume.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const consoleError = console.error;

jest.mock("../../../utils/cli");
jest.mock("../../../utils/git");
jest.mock("../../add/parseChangesetCommit");
jest.mock("../../../utils/logger");

git.add.mockImplementation(() => Promise.resolve(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import runRelease from "..";
jest.mock("../../../utils/cli");
jest.mock("../../../utils/git");
jest.mock("../../../utils/logger");
jest.mock("../../add/parseChangesetCommit");
jest.mock("../../../utils/bolt-replacements");

git.tag.mockImplementation(() => Promise.resolve(true));
Expand Down
Loading

0 comments on commit 8d2e700

Please sign in to comment.