Skip to content

First experiment of a test written as GitHub action #117

First experiment of a test written as GitHub action

First experiment of a test written as GitHub action #117

Workflow file for this run

name: QA
on: [push, pull_request]
jobs:
run_qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
# - run: ./test/run-qa.sh
# timeout-minutes: 5
- run: mkdir -p ./integrationTest1
- run: mkdir -p ./integrationTest1/baseDir
- name: Test that inputs are correctly passed to the scanner - Run
uses: ./
with:
args: -Dsonar.someArg=aValue -Dsonar.scanner.dumpToFile=./integrationTest1/output.properties
projectBaseDir: ./integrationTest1/baseDir
env:
SONAR_HOST_URL: http://not_actually_used
- name: Test that inputs are correctly passed to the scanner - Assert
run: |
if [ ! -f ./integrationTest1/output.properties ]; then
echo "File ./integrationTest1/output.properties not found"
exit 1
fi
if ! grep -q "sonar.someArg=aValue" ./integrationTest1/output.properties; then
echo "Property sonar.someArg=aValue not found in ./integrationTest1/output.properties"
exit 1
fi
if ! grep -q "sonar.projectBaseDir=.*/integrationTest1/baseDir" ./integrationTest1/output.properties; then
echo "Property sonar.projectBaseDir=./integrationTest1/baseDir not found in ./integrationTest1/output.properties"
cat ./integrationTest1/output.properties
exit 1
fi
# services:
# sonarqube:
# image: sonarqube:8.9-community
# ports:
# - 9000:9000