mirror of https://github.com/embarklabs/embark.git
ci: revise azure pipelines config to report branch and service name to coveralls
This commit is contained in:
parent
e5fc9ffdf6
commit
b5a9553599
|
@ -85,6 +85,14 @@ steps:
|
|||
yarn config set cache-folder "${PWD}/Yarn" &>/dev/null
|
||||
popd &>/dev/null
|
||||
npm run ci:full
|
||||
if [[ "$AGENT_OS" = "Linux" ]]; then
|
||||
OS="Linux"
|
||||
fi
|
||||
if [[ "$AGENT_OS" = "Darwin" ]]; then
|
||||
OS="macOS"
|
||||
fi
|
||||
export COVERALLS_GIT_BRANCH=$(node scripts/coveralls-branch-name)
|
||||
export COVERALLS_SERVICE_NAME="Azure Pipelines (${OS})"
|
||||
npm run coveralls
|
||||
condition: ne( variables['Agent.OS'], 'Windows_NT' )
|
||||
displayName: 'Test (*nix)'
|
||||
|
@ -97,6 +105,8 @@ steps:
|
|||
yarn config set cache-folder "$($PWD.Path)\Yarn" | out-null
|
||||
popd
|
||||
npm run ci:full
|
||||
$env:COVERALLS_GIT_BRANCH=node scripts/coveralls-branch-name
|
||||
$env:COVERALLS_SERVICE_NAME="Azure Pipelines (Windows)"
|
||||
npm run coveralls
|
||||
condition: eq( variables['Agent.OS'], 'Windows_NT' )
|
||||
displayName: 'Test (Windows)'
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
/* global process require */
|
||||
|
||||
const {execSync} = require('child_process');
|
||||
|
||||
const nameRevCmd = 'git name-rev --name-only HEAD';
|
||||
let branchName = execSync(nameRevCmd).toString().trim();
|
||||
|
||||
if (branchName.startsWith('remotes/pull')) {
|
||||
execSync('git checkout "HEAD^2"', {stdio: 'ignore'});
|
||||
const _branchName = branchName;
|
||||
branchName = execSync(nameRevCmd).toString().trim().split('/').slice(2).join('/');
|
||||
execSync(`git checkout ${_branchName}`, {stdio: 'ignore'});
|
||||
} else if (branchName.startsWith('remotes/origin')) {
|
||||
branchName = branchName.split('/').slice(2).join('/');
|
||||
}
|
||||
|
||||
process.stdout.write(branchName);
|
Loading…
Reference in New Issue