Skip to content

Commit

Permalink
Merge pull request #77 from ixahmedxi/ahmed/codecov-ci
Browse files Browse the repository at this point in the history
feat(ci): adds codecov to ci
  • Loading branch information
ixahmedxi committed Jun 2, 2023
2 parents 9e9963c + 5a42bf2 commit 63929d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 3
NX_CLOUD_DISTRIBUTED_EXECUTION_AGENT_COUNT: 5
NX_BRANCH: ${{ github.event.number || github.ref_name }}
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

jobs:
main:
name: Nx Cloud - Main Job
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -24,10 +24,6 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- name: Log out the PR number
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "PR sha: ${{ github.event.pull_request.head.sha }}"

- uses: actions/checkout@v3
name: Checkout [Default Branch]
Expand Down Expand Up @@ -67,6 +63,11 @@ jobs:
- name: Test
run: pnpm test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Build
run: pnpm build

Expand Down
8 changes: 6 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
},
"affected": {
"defaultBase": "main"
"defaultBase": "origin/main"
},
"namedInputs": {
"default": ["{projectRoot}/**/*"],
Expand All @@ -46,9 +46,11 @@
},
"targetDefaults": {
"lint": {
"dependsOn": ["^build"],
"inputs": ["lint"]
},
"lint:fix": {
"dependsOn": ["^build"],
"inputs": ["lint"]
},
"build": {
Expand All @@ -64,14 +66,16 @@
"dependsOn": ["build"]
},
"typecheck": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/tsconfig.tsbuildinfo"]
},
"test:coverage": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/coverage"]
},
"build-storybook": {
"inputs": ["default", "^production"],
"dependsOn": ["^build"],
"inputs": ["default", "^production"],
"outputs": ["{projectRoot}/storybook-static"]
},
"storybook": {
Expand Down

0 comments on commit 63929d1

Please sign in to comment.