-
Notifications
You must be signed in to change notification settings - Fork 10
59 lines (57 loc) · 2.74 KB
/
qa.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Контроль качества
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
oscript_version: ['1.2.0']
steps:
- uses: actions/checkout@v2
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Установка OneScript
uses: otymko/[email protected]
with:
version: ${{ matrix.oscript_version }}
- name: Установка зависимостей
run: |
opm install opm
opm install [email protected] && opm install [email protected] && opm install 1bdd && opm install 1testrunner && opm install asserts && opm install fs && opm install coverage
# - name: Авторизация в hub.docker
# uses: azure/docker-login@v1
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Запуск CRS
run: docker run --name crs-host -d -p "5000:80" otymko/crs-apache:8.3.12.1855
- name: Покрытие кода
run: opm run coverage
- name: Извлечение версии пакета
shell: bash
run: echo "##[set-output name=version;]`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'`"
id: extract_version
- name: Установка Sonar-scanner
uses: warchant/setup-sonar-scanner@v3
- name: Анализ в SonarQube (branch)
if: github.event_name == 'push' && github.repository == 'otymko/crs-api'
run: sonar-scanner
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
- name: Анализ в SonarQube (pull-request)
if: github.event_name == 'pull_request' && github.repository == 'otymko/crs-api'
run: sonar-scanner
-Dsonar.login=${{ secrets.SONARQUBE_TOKEN }}
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
-Dsonar.branch.name=${{ steps.extract_branch.outputs.branch }}
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}