Skip to content

Commit

Permalink
verbose logging on label fix (#1594)
Browse files Browse the repository at this point in the history
* add verbose logging by label

* Update run-tests.sh

* remove extraneous quote and logging

* Adding logging of verbosity

* Update PULL_REQUEST_TEMPLATE.md

* revalidate before setting verbosity

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* change runtests

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml

* Update build-and-scan.yml
  • Loading branch information
aldebaran30701 committed Dec 17, 2021
1 parent a948f03 commit 5f7c4d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/build-and-scan.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# build-and-scan.yml
# build-and-scan.yml
name: CI

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- master

Expand All @@ -28,20 +29,12 @@ jobs:
- name: Checkout Branch
uses: actions/checkout@v1

# Check the label of the PR for verbose logging
- name: Check PR labels action step
id: check_pr_labels
uses: shioyang/check-pr-labels-on-push-action@v1.0.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
labels: '["verbose logging"]'

# Set the verbose flag as a variable
- name: Set Verbosity
if: ${{ steps.check_pr_labels.outputs.result }}
run: echo '::set-output name=VERBOSITY::-verbose'
id: verbosity
run: |
if [[ ${{ contains(github.event.pull_request.labels.*.name, 'verbose-logging') }} = 'true' ]]; then echo '::set-output name=VERBOSITY::-v -verbose' && echo 'Verbose Logging Enabled'; else echo '::set-output name=VERBOSITY::-v " "' && echo 'Verbose Logging Disabled'; fi
id: verbosity

- name: Create Cache Folder
run: mkdir -p ${HOME}/.ivy2/cache

Expand All @@ -54,16 +47,16 @@ jobs:
with:
path: ${HOME}/.ivy2/cache
key: ${{ runner.os }}-dependencies-${{ env.cache-name }}-${{ hashFiles('CoreDependencies/src/ivy.xml') }}

# Update the project dependencies and run tests
- name: Run Tests
run: |
chmod +x /home/runner/work/constellation/constellation/.githubutilities/run-tests.sh
docker pull "${RUNNER_IMAGE}"
docker run --mount "type=bind,source=/home/runner/work/constellation/constellation/,target=/home/runner/work/constellation/constellation/" --mount "type=bind,source=${HOME}/.ivy2/cache,target=/root/.ivy2/cache" --workdir /home/runner/work/constellation/constellation/ "${RUNNER_IMAGE}" .githubutilities/run-tests.sh -v ${{ steps.verbosity.outputs.VERBOSITY }}
docker run --mount "type=bind,source=/home/runner/work/constellation/constellation/,target=/home/runner/work/constellation/constellation/" --mount "type=bind,source=${HOME}/.ivy2/cache,target=/root/.ivy2/cache" --workdir /home/runner/work/constellation/constellation/ "${RUNNER_IMAGE}" .githubutilities/run-tests.sh ${{ steps.verbosity.outputs.VERBOSITY }}
- name: Run Sonar
run: |
chmod +x /home/runner/work/constellation/constellation/.githubutilities/sonar.sh
docker pull "${RUNNER_IMAGE}"
docker run --mount "type=bind,source=/home/runner/work/constellation/constellation/,target=/home/runner/work/constellation/constellation/" --mount "type=bind,source=${HOME}/.ivy2/cache,target=/root/.ivy2/cache" --workdir /home/runner/work/constellation/constellation/ "${RUNNER_IMAGE}" .githubutilities/sonar.sh "${GITHUB_REPOSITORY}" "${PULL_REQUEST_NUMBER}" "${DESTINATION_BRANCH}" "${SOURCE_BRANCH}" "${SONAR_TOKEN}"
docker run --mount "type=bind,source=/home/runner/work/constellation/constellation/,target=/home/runner/work/constellation/constellation/" --mount "type=bind,source=${HOME}/.ivy2/cache,target=/root/.ivy2/cache" --workdir /home/runner/work/constellation/constellation/ "${RUNNER_IMAGE}" .githubutilities/sonar.sh "${GITHUB_REPOSITORY}" "${PULL_REQUEST_NUMBER}" "${DESTINATION_BRANCH}" "${SOURCE_BRANCH}" "${SONAR_TOKEN}"
5 changes: 0 additions & 5 deletions .githubutilities/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#!/bin/bash
set -euo pipefail

if (( $# != 2 ))
then
echo "Invalid arguments parsed."
exit 1
fi

source .githubutilities/functions.sh

Expand Down

0 comments on commit 5f7c4d2

Please sign in to comment.