Skip to content
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

Add all the bash params #193

Merged
merged 24 commits into from Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,19 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"google"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12
},
"plugins": [
"@typescript-eslint"
],
"rules": {
}
}
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Expand Up @@ -5,23 +5,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Run tests and collect coverage
run: yarn run test-all
- name: Upload coverage to Codecov
run: yarn run test
- name: Upload coverage to Codecov (demo)
uses: ./
with:
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
file: ./coverage/coverage-final.json
flags: unittest
name: codecov-1
- name: Upload coverage to Codecov (verbose)
flags: demo
name: codecov-demo
- name: Upload coverage to Codecov (script)
uses: ./
with:
files: ./coverage/calculator/coverage-final.json,./coverage/index/coverage-final.json
file: ./coverage/coverage-final.json
flags: unittest
name: codecov-1
verbose: true
files: ./coverage/script/coverage-final.json
flags: script
name: codecov-script
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
### 1.2.0

#### Features
- #193 Add all the bash params

#### Fixes
- #193 Fixes issue with working-directory

### 1.1.1

#### Fixes
Expand Down
32 changes: 28 additions & 4 deletions README.md
Expand Up @@ -20,7 +20,6 @@ steps:
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./coverage.xml # optional
files: ./coverage1.xml,./coverage2.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
Expand All @@ -36,14 +35,40 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
| Input | Description | Usage |
| :---: | :---: | :---: |
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
| `file` | Path to the coverage report(s) | Optional
| `files` | Comma-separated paths to the coverage report(s) | Optional
| `directory` | Directory to search for coverage reports. | Optional
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
| | |
| `aws_curl_args` | Extra curl arguments to communicate with AWS. | Optional
| `codecov_curl_args` | Extra curl arguments to communicate with Codecov. e.g., -U "--proxy http://http-proxy" | Optional
| `commit_parent` | The commit SHA of the parent for which you are uploading coverage. If not present, the parent will be determined using the API of your repository provider. When using the repository provider's API, the parent is determined via finding the closest ancestor to the commit. | Optional
| `env_vars` | Environment variables to tag the upload with. Multiple env variables can be separated with commas (e.g. `OS,PYTHON`) | Optional
| `name` | Custom defined name for the upload | Optional
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
| `functionalities` | Toggle functionalities | Optional
| | `coveragepy` Disable python coverage |
| | `fix` Disable report fixing |
| | `gcov` Disable gcov |
| | `gcovout` Disable gcov output |
| | `html` Enable coverage for HTML files |
| | `network` Disable uploading the file network |
| | `recursesubs` Enable recurse submodules in git projects when searching for source files | |
| | `search` Disable searching for reports |
| | `xcode` Disable xcode processing |
| `gcov path_include` | Paths to include during gcov gathering (as a glob) | Optional
| `gcov_args` | extra arguments to pass to gcov | Optional
| `gcov_executable` | gcov executable to run. Defaults to 'gcov' | Optional
| `gcov_path_exclude` | Paths to ignore during gcov gathering (as a glob) | Optional
| `gcov_prefix` | Prefix filepaths to help resolve path fixing | Optional
| `gcov_root_dir` | Project root directory, also used when preparing gcov | Optional
| `move_coverage_to_trash` | Move discovered coverage reports to the trash | Optional
| `name` | Custom defined name for the upload | Optional
| `override_branch` | Specify the branch name | Optional
| `override_build` | Specify the build number | Optional
| `override_commit` | Specify the commit SHA | Optional
| `override_pr` | Specify the pull request number | Optional
| `override_tag` | Specify the git tag | Optional
| `path_to_write_report` | Write upload file to path before uploading | Optional
| `root_dir` | Used when not in git/hg project to identify project root directory | Optional
| `verbose` | Specify whether the Codecov output should be verbose | Optional
| `working-directory` | Directory in which to execute `codecov.sh` | Optional
| `xcode_derived_data` | Custom Derived Data Path for Coverage.profdata and gcov processing | Optional
Expand Down Expand Up @@ -78,7 +103,6 @@ jobs:
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
files: ./coverage1.xml,./coverage2.xml
directory: ./coverage/reports/
flags: unittests
Expand Down
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions demo/coverage-test/coverage.test.ts
@@ -0,0 +1,11 @@
import Coverage from "./coverage";

test('test uncovered if', () => {
const coverageObj = new Coverage();
expect(coverageObj.uncovered_if()).toEqual(false);
});

test('fully covered', () => {
const coverageObj = new Coverage();
expect(coverageObj.fully_covered()).toEqual(true);
});
2 changes: 1 addition & 1 deletion src/index/index.ts → demo/coverage-test/coverage.ts
@@ -1,4 +1,4 @@
export default class Index {
export default class Coverage {

//This function is tested and part of it is uncovered
uncovered_if = (a = true) => {
Expand Down