-
Notifications
You must be signed in to change notification settings - Fork 33
ci: add codecov
integration
#40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4bfd802
chore: add `codecov.yml`
brionmario db28726
chore: implement basic unit test setup
brionmario fdd93d3
ci: integrate `codecov/codecov-action`
brionmario d499fe6
chore(core): add `jest` dependency
brionmario 2d82ffd
chore(core): temp skip test case
brionmario 2ce1034
ci: stop concurrent runs
brionmario d3b4a47
chore(core): remove redundant comment
brionmario 1a247a9
ci: update codecov.yml
brionmario 4c2d200
ci: update codecov.yml
brionmario 0366f2a
ci: update PR builder
brionmario e1ca593
ci: update PR builder
brionmario bfeb7f4
ci: revert flags [experiment]
brionmario e525549
Revert "ci: revert flags [experiment]"
brionmario File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,11 @@ on: | |
- "LICENSE" | ||
workflow_dispatch: | ||
|
||
# Avoid running multiple builds for the same PR. | ||
concurrency: | ||
group: pr-builder-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -169,7 +174,23 @@ jobs: | |
|
||
- name: 🃏 Run Jest & Collect Coverage | ||
id: run-jest-test-and-coverage | ||
run: pnpm test | ||
run: pnpm test:ci | ||
|
||
- name: Upload `@asgardeo/js` coverage reports to Codecov | ||
id: upload-asgardeo-js-coverage | ||
uses: codecov/[email protected] | ||
with: | ||
files: ./packages/core/coverage/coverage-final.json | ||
flags: '@asgardeo/js' | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Upload `@asgardeo/react` coverage reports to Codecov | ||
id: upload-asgardeo-react-coverage | ||
uses: codecov/[email protected] | ||
with: | ||
files: ./packages/core/coverage/coverage-final.json | ||
flags: '@asgardeo/react' | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
build: | ||
name: 🚧 Build | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ------------------------------------------------------------------------------------- | ||
# | ||
# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). | ||
# | ||
# WSO2 LLC. licenses this file to you under the Apache License, | ||
# Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# -------------------------------------------------------------------------------------- | ||
|
||
# This workflow will run the Codecov action on the repository. | ||
|
||
codecov: | ||
require_ci_to_pass: yes | ||
notify: | ||
wait_for_ci: yes | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
enabled: yes | ||
threshold: null | ||
target: auto | ||
patch: | ||
default: | ||
target: 80% | ||
threshold: 40% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import type {Config} from '@jest/types'; | ||
|
||
const jestConfig: Config.InitialOptions = { | ||
displayName: '@asgardeo/js', | ||
extensionsToTreatAsEsm: ['.ts'], | ||
moduleDirectories: ['node_modules', 'test-configs', __dirname], | ||
moduleFileExtensions: ['js', 'ts', 'json', 'node'], | ||
moduleNameMapper: { | ||
'^@unit-testing(.*)$': '<rootDir>/test-configs/utils', | ||
}, | ||
modulePaths: ['<rootDir>'], | ||
preset: 'ts-jest', | ||
setupFilesAfterEnv: ['<rootDir>/test-configs/setup-test.ts'], | ||
testEnvironment: 'node', | ||
testMatch: ['<rootDir>/**/?(*.)test.{ts,js}'], | ||
testPathIgnorePatterns: ['<rootDir>/(dist|node_modules)/'], | ||
transform: { | ||
'^.+\\.ts?$': [ | ||
'ts-jest', | ||
{ | ||
useESM: true, | ||
}, | ||
], | ||
}, | ||
transformIgnorePatterns: [], | ||
verbose: true, | ||
}; | ||
|
||
export default jestConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.