Skip to content

Commit

Permalink
Merge pull request #193 from codecov/v2
Browse files Browse the repository at this point in the history
Add all the bash params
  • Loading branch information
thomasrockhu committed Jan 4, 2021
2 parents 5b42a30 + 8d13d6a commit a92c414
Show file tree
Hide file tree
Showing 18 changed files with 1,475 additions and 461 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a92c414

Please sign in to comment.