Skip to content

Commit

Permalink
First experiment of a test written as GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed May 13, 2024
1 parent 6abcb25 commit 3d0d4a9
Showing 1 changed file with 43 additions and 8 deletions.
51 changes: 43 additions & 8 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,51 @@ name: QA
on: [push, pull_request]

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

0 comments on commit 3d0d4a9

Please sign in to comment.