From 217f62d9d1e24bb772f0e8147176d1f0782713ab Mon Sep 17 00:00:00 2001 From: Aleksey Khorev Date: Tue, 12 Mar 2019 22:02:29 +0300 Subject: [PATCH 1/5] =?UTF-8?q?fix=20#22=20=D0=9C=D0=B5=D1=82=D0=BE=D0=B4?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=87=D0=B8=D1=82=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\320\274\320\265\321\202\321\200\320\276\320\262.os" | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git "a/src/\320\232\320\273\320\260\321\201\321\201\321\213/\320\234\320\265\320\275\320\265\320\264\320\266\320\265\321\200\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\320\276\320\262.os" "b/src/\320\232\320\273\320\260\321\201\321\201\321\213/\320\234\320\265\320\275\320\265\320\264\320\266\320\265\321\200\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\320\276\320\262.os" index ffd7365..dcfff97 100644 --- "a/src/\320\232\320\273\320\260\321\201\321\201\321\213/\320\234\320\265\320\275\320\265\320\264\320\266\320\265\321\200\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\320\276\320\262.os" +++ "b/src/\320\232\320\273\320\260\321\201\321\201\321\213/\320\234\320\265\320\275\320\265\320\264\320\266\320\265\321\200\320\237\320\260\321\200\320\260\320\274\320\265\321\202\321\200\320\276\320\262.os" @@ -56,6 +56,15 @@ Возврат ЧтениеПараметровВыполнено; КонецФункции +// Возвращает соответствие прочитанных параметров +// +// Возвращаемое значение: +// Соответствие - прочитанные параметров +// +Функция ПрочитанныеПараметры() Экспорт + Возврат ПрочитанныеПараметры; +КонецФункции + // Выполняет чтения параметров из доступных провайдеров // Процедура Прочитать() Экспорт From 4b81bfa27966c5c7456976ce5f8e3332becc8b70 Mon Sep 17 00:00:00 2001 From: Karim Shakirov Date: Sun, 30 Jun 2019 15:27:44 +0300 Subject: [PATCH 2/5] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Неправильно поставлен пробел --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77f6cb8..47d706a 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ ```bsl - МенеджерПараметров = Новы йМенеджерПараметров() + МенеджерПараметров = Новый МенеджерПараметров() МенеджерПараметров.КонструкторПараметров(ПараметрыПриложения); МенеджерПараметров.Прочитать(); From 8c7cdc118b3be98678a6dc57f1386dea09510e66 Mon Sep 17 00:00:00 2001 From: khorevaa Date: Tue, 15 Dec 2020 11:38:12 +0300 Subject: [PATCH 3/5] add github actions --- .github/workflows/qa.yml | 77 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 57 +++++++++++++++++++++++++ .github/workflows/testing.yml | 46 +++++++++++++++++++++ .travis.yml | 78 ----------------------------------- packagedef | 2 +- sonar-qube.sh | 22 ---------- sonarlint.json | 5 --- travis-ci.sh | 18 -------- 8 files changed, 181 insertions(+), 124 deletions(-) create mode 100644 .github/workflows/qa.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/testing.yml delete mode 100644 .travis.yml delete mode 100644 sonar-qube.sh delete mode 100644 sonarlint.json delete mode 100644 travis-ci.sh diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..8b007b6 --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,77 @@ +# MIT License +# Copyright (C) 2020 Tymko Oleg and contributors +# All rights reserved. + +name: Контроль качества +# Любой пуш и pr в проекте но с фильтром по основному проекту +on: [push, pull_request] +jobs: + build: + if: github.repository == 'khorevaa/configor' + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + oscript_version: ['1.4.0'] + + steps: + # Загрузка проекта + - name: Актуализация + uses: actions/checkout@v2 + + # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions + - name: Извлечение имени текущей ветки + shell: bash + run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + # Установка OneScript конкретной версии + - name: Установка OneScript + uses: otymko/setup-onescript@v1.0 + with: + version: ${{ matrix.oscript_version }} + + # Установка зависимостей пакета + - name: Установка зависимостей + run: | + opm install opm + opm install --dev + opm install 1testrunner + opm install 1bdd + opm install notify + opm install coverage + + # Запуск тестов и сбор покрытия кода + - name: Покрытие кода + run: oscript ./tasks/coverage.os true + + - 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@v1 + + # Анализ проекта в SonarQube (ветка) + - name: Анализ в SonarQube (branch) + if: github.event_name == 'push' + 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 }} + + # Анализ проекта в SonarQube (PR) + # https://docs.sonarqube.org/latest/analysis/pull-request/ + - name: Анализ в SonarQube (pull-request) + if: github.event_name == 'pull_request' + 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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3473b01 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +# MIT License +# Copyright (C) 2020 Tymko Oleg and contributors +# All rights reserved. + +name: Подготовка релиза и публикация в хабе +# Только события создания и изменения релиза +on: + release: + types: [published, edited] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + oscript_version: ['1.4.0'] + package_mask: ["configor-*.ospx"] + + steps: + # Загрузка проекта + - name: Актуализация + uses: actions/checkout@v2 + + # Установка OneScript конкретной версии + - name: Установка OneScript + uses: otymko/setup-onescript@v1.0 + with: + version: ${{ matrix.oscript_version }} + + # Установка зависимостей пакета + - name: Установка зависимостей + run: | + opm install opm + opm install + + - name: Сборка пакета + run: opm build + + - name: Заливка артифактов + uses: actions/upload-artifact@v2 + with: + name: package.zip + path: ./${{ matrix.package_mask }} + + - name: Заливка в релиз + uses: AButler/upload-release-assets@v1.0 + with: + files: ./${{ matrix.package_mask }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Публикация в hub.oscript.io + shell: bash + run: opm push -f ./${{ matrix.package_mask }} --token ${{ env.TOKEN }} -c stable + env: + TOKEN: ${{ secrets.ACCESS_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..fabd733 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,46 @@ +# MIT License +# Copyright (C) 2020 Tymko Oleg and contributors +# All rights reserved. + +name: Тестирование +# Любой пуш и pr в проекте +on: [push, pull_request] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + oscript_version: ['1.4.0'] + + steps: + # Загрузка проекта + - name: Актуализация + uses: actions/checkout@v2 + + # Установка OneScript конкретной версии + - name: Установка OneScript + uses: otymko/setup-onescript@v1.0 + with: + version: ${{ matrix.oscript_version }} + + # Установка зависимостей пакета + - name: Установка зависимостей + run: | + opm install opm + opm install --dev + opm install 1testrunner + opm install 1bdd + opm install notify + opm install coverage + + # Задача тестирования, в результате ожидается успешное выполнение + - name: Тестирование Unit + run: oscript ./tasks/test.os true + + # - name: Тестирование Integrated + # run: | + # docker run -e OSCRIPT_VERSION=${{ matrix.oscript_version }} -v $(pwd):/work_dir harmit/ci-image sh -c 'cd /work_dir; sh /work_dir/travis-ci.sh; exit' + # grep 'Результат прогона тестов <Да>' /tmp/test.log \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 10cce20..0000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -sudo: required -language: generic - -notifications: - email: false -env: - global: - - CHANNEL=dev - - PACKAGE_NAME=configor - matrix: - - OSCRIPT_VERSION=1_0_19 - - OSCRIPT_VERSION=1_0_20 - - OSCRIPT_VERSION=night-build -matrix: - allow_failures: - - env: OSCRIPT_VERSION=night-build - -services: - - docker - -addons: - sonarqube: true - -jdk: - - oraclejdk8 - -before_install: - # Load cached docker images - - if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi - -before_cache: - # Save tagged docker images - - > - mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}' - | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz' - -install: - - docker pull evilbeaver/onescript:1.0.19 - -script: - - docker version - - docker run -it -e OSCRIPT_VERSION=$OSCRIPT_VERSION -v $(pwd):/work_dir evilbeaver/onescript:1.0.19 sh -c 'cd /work_dir; sh /work_dir/travis-ci.sh; exit' | tee /tmp/test.log - - grep 'Результат прогона тестов <Да>' /tmp/test.log -after_success: - - bash <(curl -s https://codecov.io/bash) -f coverage/coverage.json - # - ./sonar-qube.sh - -cache: - directories: - - '$HOME/.m2/repository' - - '$HOME/.sonar/cache' - - '$HOME/docker' -jobs: - include: - - stage: Сборка и публикация github & hub.oscript.io - script: skip - before_deploy: - - docker run -it -v $(pwd):/work_dir evilbeaver/onescript:1.0.19 sh -c 'cd /work_dir; opm build ./ ; exit' - deploy: - - provider: releases - api_key: "$GITHUB_OAUTH_TOKEN" - file_glob: true - file: $PACKAGE_NAME*.ospx - skip_cleanup: true - on: - branch: master - tags: true - - provider: script - skip_cleanup: true - script: docker run -it -v $(pwd):/work_dir evilbeaver/onescript:1.0.19 sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel dev --file ./$PACKAGE_NAME-*.ospx; exit' - on: - branch: develop - - provider: script - skip_cleanup: true - script: docker run -it -v $(pwd):/work_dir evilbeaver/onescript:1.0.19 sh -c 'cd /work_dir; opm push --token $GITHUB_OAUTH_TOKEN --channel stable --file ./$PACKAGE_NAME-*.ospx; exit' - on: - branch: master - tags: true diff --git a/packagedef b/packagedef index 846e31f..48e6d78 100644 --- a/packagedef +++ b/packagedef @@ -4,7 +4,7 @@ // Описание.Имя("configor") - .Версия("0.6.3") + .Версия("0.7.0") .Автор("Khorev Aleksey") .АдресАвтора("Khorevaa@gmail.com") .Описание("Библиотека для работы с конфигурационными файлами в формате json, yaml") diff --git a/sonar-qube.sh b/sonar-qube.sh deleted file mode 100644 index f56f2f2..0000000 --- a/sonar-qube.sh +++ /dev/null @@ -1,22 +0,0 @@ -temp=`cat packagedef | grep ".Версия(" | sed 's|[^"]*"||' | sed -r 's/".+//'` -version=${temp##*|} - -if [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]; then - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - sonar-scanner \ - -Dsonar.host.url=https://sonar.silverbulleters.org \ - -Dsonar.analysis.mode=issues \ - -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \ - -Dsonar.github.repository=$TRAVIS_REPO_SLUG \ - -Dsonar.github.oauth=$GITHUB_OAUTH_TOKEN \ - -Dsonar.login=$SONAR_TOKEN \ - -Dsonar.scanner.skip=false - - elif [ "$TRAVIS_BRANCH" == "develop" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - sonar-scanner \ - -Dsonar.host.url=https://sonar.silverbulleters.org \ - -Dsonar.login=$SONAR_TOKEN \ - -Dsonar.projectVersion=$version\ - -Dsonar.scanner.skip=false - fi -fi \ No newline at end of file diff --git a/sonarlint.json b/sonarlint.json deleted file mode 100644 index 46765a9..0000000 --- a/sonarlint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/silverbulleters/sonarqube-inject-vsc/master/schemas/sonarlint.json", - "serverId": "SB", - "projectKey": "opensource-cli" -} \ No newline at end of file diff --git a/travis-ci.sh b/travis-ci.sh deleted file mode 100644 index 4d5204c..0000000 --- a/travis-ci.sh +++ /dev/null @@ -1,18 +0,0 @@ - - -set -e -echo "Устанавливаю версию OScript <$OSCRIPT_VERSION>" -curl http://oscript.io/downloads/$OSCRIPT_VERSION/deb > oscript.deb -dpkg -i oscript.deb -rm -f oscript.deb - -opm install 1testrunner; -opm install 1bdd; -opm install notify; -opm install coverage; -opm install; - - -opm run coverage; - - From b19a2a23be480a037d38e6904302aeb941c97079 Mon Sep 17 00:00:00 2001 From: khorevaa Date: Tue, 15 Dec 2020 11:48:25 +0300 Subject: [PATCH 4/5] add ACTIONS_ALLOW_UNSECURE_COMMANDS: true --- .github/workflows/qa.yml | 4 +++- .github/workflows/release.yml | 2 ++ .github/workflows/testing.yml | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 8b007b6..34b08cd 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - oscript_version: ['1.4.0'] + oscript_version: ['1.4.0', '1.5.0'] steps: # Загрузка проекта @@ -29,6 +29,8 @@ jobs: # Установка OneScript конкретной версии - name: Установка OneScript uses: otymko/setup-onescript@v1.0 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true with: version: ${{ matrix.oscript_version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3473b01..16b4c75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,8 @@ jobs: # Установка OneScript конкретной версии - name: Установка OneScript + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true uses: otymko/setup-onescript@v1.0 with: version: ${{ matrix.oscript_version }} diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fabd733..3744831 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - oscript_version: ['1.4.0'] + oscript_version: ['1.4.0', '1.5.0'] steps: # Загрузка проекта @@ -22,6 +22,8 @@ jobs: # Установка OneScript конкретной версии - name: Установка OneScript + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true uses: otymko/setup-onescript@v1.0 with: version: ${{ matrix.oscript_version }} From e21836af01cf0be3d3706a7568f6072150f3acac Mon Sep 17 00:00:00 2001 From: khorevaa Date: Tue, 15 Dec 2020 13:11:28 +0300 Subject: [PATCH 5/5] fix fs import --- tasks/coverage.os | 1 + tasks/test.os | 1 + 2 files changed, 2 insertions(+) diff --git a/tasks/coverage.os b/tasks/coverage.os index a136c94..3f50e0e 100644 --- a/tasks/coverage.os +++ b/tasks/coverage.os @@ -1,5 +1,6 @@ #Использовать coverage #Использовать 1commands +#Использовать fs ФС.ОбеспечитьПустойКаталог("coverage"); ПутьКСтат = "coverage/stat.json"; diff --git a/tasks/test.os b/tasks/test.os index c2c954d..dff66ce 100644 --- a/tasks/test.os +++ b/tasks/test.os @@ -1,6 +1,7 @@ #Использовать "../" #Использовать 1bdd #Использовать 1testrunner +#Использовать fs Функция ПрогнатьТесты()