Skip to content

Quality Assurance #1615

Quality Assurance

Quality Assurance #1615

name: Quality Assurance
on:
workflow_dispatch:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
types: [opened, synchronize, reopened]
schedule:
- cron: 0 16 * * *
jobs:
pre-commit-checks:
name: pre-commit-checks
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull pre-commit-check
- name: Run pre commit checks
run: |
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from pre-commit-check pre-commit-check
acceptance-tests:
name: acceptance-tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull behave
- name: Run behave tests
run: |
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from behave behave
- name: upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: ./mrmap/acceptance-tests-coverage-report.xml
unit-tests:
name: unit-tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull django-tests
- name: Run unit tests
run: |
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from django-tests django-tests
- name: upload coverage reports
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: ./backend/unit-tests-coverage-report.xml
sonar-scanner:
needs: [acceptance-tests, unit-tests]
name: sonar-scanner
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: pull needed docker images
run: docker-compose -f docker-compose.yml -f docker-compose.dev.yml pull pre-commit-check
- name: download coverage reports
uses: actions/download-artifact@v2
with:
name: coverage-reports
path: ./mrmap
- name: Run sonar-scanner
run: |
echo -en "\n" >> ./mrmap/sonar-project.properties
echo "sonar.branch.name=$GITHUB_HEAD_REF" >> ./mrmap/sonar-project.properties
echo "sonar.branch.target=$GITHUB_BASE_REF" >> ./mrmap/sonar-project.properties
echo "sonar.login=${{ secrets.SONAR_TOKEN }}" >> ./mrmap/sonar-project.properties
cat ./mrmap/sonar-project.properties
ls ./mrmap
GITHUB_TOKEN='${{ secrets.GITHUB_TOKEN }}' docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --abort-on-container-exit --exit-code-from sonar-scanner sonar-scanner