Skip to content

Commit

Permalink
feat: removed support for coveralls, now only using codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
yann510 committed Sep 29, 2021
1 parent 0f1b94b commit d23c89c
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 58 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/nx-affected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,12 @@ jobs:
- name: Run e2e tests
run: npm run affected:e2e -- --base=$BASE --head=$HEAD

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ github.token }}
path-to-lcov: ./coverage/apps/api/lcov.info
fail_ci_if_error: false

- name: Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/apps/api/
continue-on-error: true
fail_ci_if_error: false

- name: Archive code coverage results
uses: actions/upload-artifact@v2
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<a href="https://github.com/chocolat-chaud-io/stator/actions">
<img src="https://github.com/chocolat-chaud-io/stator/workflows/stator%20CI/badge.svg" alt="Github action status" />
</a>
<a href="https://coveralls.io/github/chocolat-chaud-io/stator?branch=master">
<img src="https://coveralls.io/repos/github/chocolat-chaud-io/stator/badge.svg?branch=master" alt="Coverage Status" />
<a href="https://codecov.io/gh/chocolat-chaud-io/stator">
<img src="https://codecov.io/gh/chocolat-chaud-io/stator/branch/master/graph/badge.svg?token=3XN225FUIT" alt="Coverage Status" />
</a>
<a href="http://commitizen.github.io/cz-cli/">
<img src="https://img.shields.io/badge/commitizen-friendly-ff69b4.svg" alt="Commitizen friendly" />
Expand Down Expand Up @@ -178,7 +178,7 @@ For a full list of available commands, consult the `package.json`.
This templates integrates Github Actions for its Continuous Integration. The existing workflows are under `.github/workflows`.
To have the CI working, you must:

1. (Optional) Link your repository with [Coveralls](https://coveralls.io/repos/new), or with [Codecov](https://github.com/apps/codecov) by inserting your `CODECOV_TOKEN` in github secrets.
1. (Optional) Link your repository with [Codecov](https://github.com/apps/codecov) by inserting your `CODECOV_TOKEN` in github secrets.
1. (Optional) Insert your [Nx Cloud](https://nx.app/) access token in github secrets under `NX_CLOUD_TOKEN`. This enables for caching and faster build times.

### Deployment
Expand Down
3 changes: 3 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const nxPreset = require("@nrwl/jest/preset")

module.exports = { ...nxPreset }
36 changes: 18 additions & 18 deletions tools/getting-started/src/ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Ui: FC = () => {

const [organizationName, setOrganizationName] = useState(initialInputValue)
const [projectName, setProjectName] = useState(initialInputValue)
const [coverallsToken, setCoverallsToken] = useState(initialInputValue)
const [codecovToken, setCodecovToken] = useState(initialInputValue)
const [nxCloudToken, setNxCloudToken] = useState(initialInputValue)
const [digitalOceanToken, setDigitalOceanToken] = useState(initialInputValue)

Expand Down Expand Up @@ -67,17 +67,17 @@ const Ui: FC = () => {
setProjectName(value => ({ ...value, isValid: true }))
}

const onCoverallsSubmit = () => {
setCoverallsToken(value => cloneInputValueWithoutError(value))
const onCodecovSubmit = () => {
setCodecovToken(value => cloneInputValueWithoutError(value))

const tokenRegex = /^[a-zA-Z\d]{30,40}$/
if (coverallsToken.value !== "" && !tokenRegex.test(coverallsToken.value.trim())) {
return setCoverallsToken(value =>
cloneInputValueWithError(value, "The token you provided doesn't respect the coveralls token format")
const tokenRegex = /^[a-zA-Z\d-]{30,40}$/
if (codecovToken.value !== "" && !tokenRegex.test(codecovToken.value.trim())) {
return setCodecovToken(value =>
cloneInputValueWithError(value, "The token you provided doesn't respect the Codecov token format")
)
}

setCoverallsToken(value => ({ ...value, isValid: true }))
setCodecovToken(value => ({ ...value, isValid: true }))
}

const onNxCloudTokenSubmit = () => {
Expand Down Expand Up @@ -130,30 +130,30 @@ const Ui: FC = () => {
<>
<Box marginTop={1} />

<Divider title="Coveralls" width={dividerWidth} />
<Divider title="Codecov" width={dividerWidth} />

<Link url="https://coveralls.io/sign-in">
<Text bold>1. Log in on the Coveralls website</Text>
<Link url="https://app.codecov.io/login/gh">
<Text bold>1. Log in on the Codecov website</Text>
</Link>
<Link url="https://coveralls.io/repos/new">
<Link url="https://app.codecov.io/gh/+">
<Text bold>2. Link your repository</Text>
</Link>
<Text bold>3. Click on the details of your repository</Text>
<Text bold>3. Add the token in your GitHub secrets of your project</Text>
<Text bold>4. Copy the token from the top right and paste it in the input below</Text>

<Box marginBottom={1} />

<LabelValueInput
label="Coveralls token [optional]"
label="Codecov token [optional]"
placeholder="Press enter to skip"
inputValue={coverallsToken}
onChange={value => setCoverallsToken({ ...coverallsToken, value })}
onSubmit={onCoverallsSubmit}
inputValue={codecovToken}
onChange={value => setCodecovToken({ ...codecovToken, value })}
onSubmit={onCodecovSubmit}
/>
</>
)}

{coverallsToken.isValid && (
{codecovToken.isValid && (
<>
<Box marginTop={1} />

Expand Down
75 changes: 47 additions & 28 deletions workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
"main": "apps/api/src/main.ts",
"tsConfig": "apps/api/tsconfig.app.json",
"assets": ["apps/api/src/assets"],
"webpackConfig": "apps/api/webpack.config.ts"
"webpackConfig": "apps/api/webpack.config.ts",
"showCircularDependencies": false,
"maxWorkers": 2,
"memoryLimit": 1024
},
"configurations": {
"production": {
Expand All @@ -29,14 +32,23 @@
}
]
}
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"builder": "@nrwl/node:execute",
"options": {
"buildTarget": "api:build"
}
},
"debug": {
"builder": "@nrwl/node:execute",
"options": {
"buildTarget": "api:build",
"inspect": true,
"port": 7777
}
},
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
Expand All @@ -50,7 +62,32 @@
"options": {
"jestConfig": "apps/api/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/apps/api"]
}
}
},
"models": {
"root": "libs/models",
"sourceRoot": "libs/models/src",
"projectType": "library",
"schematics": {},
"architect": {
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
"linter": "eslint",
"tsConfig": ["libs/models/tsconfig.lib.json", "libs/models/tsconfig.spec.json"],
"exclude": ["**/node_modules/**", "!libs/models/**/*"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/models/jest.config.js",
"passWithNoTests": true
},
"outputs": ["coverage/libs/models"]
}
}
},
Expand All @@ -71,7 +108,10 @@
"assets": ["apps/webapp/src/favicon.ico", "apps/webapp/src/assets"],
"styles": ["apps/webapp/src/styles.scss"],
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
"webpackConfig": "@nrwl/react/plugins/webpack",
"showCircularDependencies": false,
"maxWorkers": 2,
"memoryLimit": 1024
},
"configurations": {
"production": {
Expand All @@ -96,7 +136,8 @@
}
]
}
}
},
"outputs": ["{options.outputPath}"]
},
"serve": {
"builder": "@nrwl/web:dev-server",
Expand All @@ -122,7 +163,8 @@
"options": {
"jestConfig": "apps/webapp/jest.config.js",
"passWithNoTests": true
}
},
"outputs": ["coverage/apps/webapp"]
}
}
},
Expand Down Expand Up @@ -153,29 +195,6 @@
}
}
}
},
"models": {
"root": "libs/models",
"sourceRoot": "libs/models/src",
"projectType": "library",
"schematics": {},
"architect": {
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
"linter": "eslint",
"tsConfig": ["libs/models/tsconfig.lib.json", "libs/models/tsconfig.spec.json"],
"exclude": ["**/node_modules/**", "!libs/models/**/*"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/models/jest.config.js",
"passWithNoTests": true
}
}
}
}
},
"cli": {
Expand Down

0 comments on commit d23c89c

Please sign in to comment.