Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Load grcov config from the default path if input is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
svartalf committed Sep 25, 2019
1 parent 7c5b875 commit a8f8c0e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.1.1] - 2019-09-25

### Fixed

- Use default path for `grcov.yml` file is input is not provided

## [0.1.0] - 2019-09-25

### Added

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rust-grcov",
"version": "0.1.0",
"version": "0.1.1",
"private": false,
"description": "Collect and aggregate code coverage information with the Mozilla grcov tool",
"main": "lib/main.js",
Expand Down
10 changes: 8 additions & 2 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import stringArgv from 'string-argv';
import * as core from '@actions/core';
import {input} from '@actions-rs/core';

const DEFAULT_CONFIG_PATH = '.github/actions-rs/grcov.yml';

/**
* These value are defined by the Action inputs
Expand Down Expand Up @@ -78,8 +79,13 @@ Did you forgot to checkout the code first?');
if (relConfigPath.length > 0) {
inputs.configPath = path.join(
process.env.GITHUB_WORKSPACE!,
relConfigPath
relConfigPath,
);
} else {
inputs.configPath = path.join(
process.env.GITHUB_WORKSPACE!,
DEFAULT_CONFIG_PATH,
)
}

return inputs;
Expand Down Expand Up @@ -119,7 +125,7 @@ async function loadUser(path: string): Promise<User> {
user.prefixDir = contents['prefix-dir'];
}

core.debug(`Parsed grcov configuration: ${user}`);
core.debug(`User configuration: ${JSON.stringify(user)}`);

return user;
}
Expand Down

0 comments on commit a8f8c0e

Please sign in to comment.