1
0
mirror of https://github.com/bia-technologies/yaxunit.git synced 2025-01-23 18:54:40 +02:00

Merge pull request #155 from bia-technologies/feature/windows-support

use windows ci
This commit is contained in:
Koryakin Aleksey 2023-09-04 17:13:29 +03:00 committed by GitHub
commit 77f78208a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 242 additions and 141 deletions

74
.github/workflows/build-on-windows.yml vendored Normal file
View File

@ -0,0 +1,74 @@
name: Build
on:
workflow_call:
inputs:
v8_version:
type: string
required: true
src_artifact_name:
type: string
required: true
artifact_name:
type: string
required: true
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- name: install Onec Platform
uses: alkoleft/onec-setup-build-env-action@develop
with:
type: onec
onec_version: ${{ inputs.v8_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10
- name: download artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.src_artifact_name }}
- run: |
mkdir export
mkdir binary
cd export
7z x ../export.7z -y
- name: create IB
run: ibcmd infobase create --db-path=file-db --import=export\configuration --apply --force
timeout-minutes: 5
- name: import yaxunit
run: ibcmd infobase config import --db-path=file-db --extension=YAXUNIT export\yaxunit
timeout-minutes: 5
- name: import tests
run: ibcmd infobase config import --db-path=file-db --extension=tests export\tests
timeout-minutes: 5
- name: save yaxunit
run: ibcmd infobase config save --db-path=file-db --extension=YAXUNIT binary\yaxunit.cfe
timeout-minutes: 5
- name: save tests
run: ibcmd infobase config save --db-path=file-db --extension=tests binary\tests.cfe
timeout-minutes: 5
- name: save configuration
run: ibcmd infobase config save --db-path=file-db binary\configuration.cf
timeout-minutes: 5
- name: upload-artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: binary\*.*

View File

@ -1,97 +0,0 @@
name: Build
on:
workflow_call:
inputs:
v8_version:
type: string
required: true
edt_version:
type: string
required: true
artifact_name:
type: string
required: true
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: install EDT
uses: IT-Medved/onec-setup-build-env-action@develop
with:
type: edt
edt_version: ${{ inputs.edt_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10
- name: install Onec Platform
uses: IT-Medved/onec-setup-build-env-action@develop
with:
type: onec
onec_version: ${{ inputs.v8_version }}
cache: false
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10
- name: convert configuration src
uses: IT-Medved/onec-edtcli-command-action@feature/init
with:
export: true
from: fixtures/demo-configuration
to: export/configuration
timeout-minutes: 5
- name: convert yaxunit src
uses: IT-Medved/onec-edtcli-command-action@feature/init
with:
export: true
from: exts/yaxunit
to: export/yaxunit
timeout-minutes: 5
- name: convert tests src
uses: IT-Medved/onec-edtcli-command-action@feature/init
with:
export: true
from: tests
to: export/tests
timeout-minutes: 5
- name: create IB
run: ibcmd infobase create --db-path=file-db --import=export/configuration --apply --force
timeout-minutes: 5
- name: import yaxunit
run: ibcmd infobase config import --db-path=file-db --extension=YAXUNIT export/yaxunit
timeout-minutes: 5
- name: import tests
run: ibcmd infobase config import --db-path=file-db --extension=tests export/tests
timeout-minutes: 5
- run: mkdir binary -p
- name: save yaxunit
run: ibcmd infobase config save --db-path=file-db --extension=YAXUNIT binary/yaxunit.cfe
timeout-minutes: 5
- name: save tests
run: ibcmd infobase config save --db-path=file-db --extension=tests binary/tests.cfe
timeout-minutes: 5
- name: save configuration
run: ibcmd infobase config save --db-path=file-db binary/configuration.cf
timeout-minutes: 5
- name: upload-artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: binary/*.*

65
.github/workflows/export-xml.yml vendored Normal file
View File

@ -0,0 +1,65 @@
name: Export to designer xml
on:
workflow_call:
inputs:
edt_version:
type: string
required: true
artifact_name:
type: string
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install EDT
uses: IT-Medved/onec-setup-build-env-action@develop
with:
type: edt
edt_version: ${{ inputs.edt_version }}
cache: true
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10
- name: convert configuration src
uses: alkoleft/onec-edtcli-command-action@main
with:
export: true
from: fixtures/demo-configuration
to: export/configuration
timeout: 5
timeout-minutes: 10
- name: convert yaxunit src
uses: alkoleft/onec-edtcli-command-action@main
with:
export: true
from: exts/yaxunit
to: export/yaxunit
timeout: 5
timeout-minutes: 10
- name: convert tests src
uses: alkoleft/onec-edtcli-command-action@main
with:
export: true
from: tests
to: export/tests
timeout: 5
timeout-minutes: 10
- run: |
cd export
7za a -t7z ../export.7z ./
- name: upload-artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: export.7z
if-no-files-found: error

View File

@ -15,12 +15,21 @@ permissions:
id-token: write
jobs:
export_to_designer:
name: Export to designer xml
uses: ./.github/workflows/export-xml.yml
with:
edt_version: 2023.1.2
artifact_name: designer-src
secrets: inherit
build_artifacts:
name: Build artifacts
uses: ./.github/workflows/build.yml
uses: ./.github/workflows/build-on-windows.yml
needs: export_to_designer
with:
v8_version: 8.3.21.1895
edt_version: 2023.1.2
src_artifact_name: designer-src
artifact_name: build-artifacts
secrets: inherit
@ -53,12 +62,3 @@ jobs:
v8_version: 8.3.21.1895
artifact_name: build-artifacts
secrets: inherit
tests_macos_ru:
name: Tests MacOS 8.3.21.1895 ru_RU
uses: ./.github/workflows/run-tests-macos.yml
needs: build_artifacts
with:
v8_version: 8.3.21.1895
artifact_name: build-artifacts
secrets: inherit

View File

@ -1,29 +0,0 @@
name: Run tests on MacOS
on:
workflow_call:
inputs:
v8_version:
description: 'Platform version'
type: string
required: true
locale:
type: string
required: false
default: ru_RU
artifact_name:
type: string
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.v8_version }}-${{ inputs.locale }}-MacOS
cancel-in-progress: true
jobs:
execute-tests:
runs-on: macos-latest
if: false
steps:
- run: echo 'empty'

View File

@ -17,6 +17,11 @@ on:
type: string
required: true
fail_on_failure:
type: boolean
required: false
default: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.v8_version }}-${{ inputs.locale }}-Windows
cancel-in-progress: true
@ -24,6 +29,89 @@ concurrency:
jobs:
execute-tests:
runs-on: windows-latest
if: false
defaults:
run:
shell: pwsh
steps:
- run: echo 'empty'
- name: download artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: binary
- name: install platform
uses: alkoleft/onec-setup-build-env-action@develop
with:
type: onec
onec_version: ${{ inputs.v8_version }}
env:
ONEC_USERNAME: ${{ secrets.ONEC_USERNAME }}
ONEC_PASSWORD: ${{ secrets.ONEC_PASSWORD }}
timeout-minutes: 10
- name: create IB
run: |
mkdir data\data
ibcmd.exe infobase create --data=data --load=binary\configuration.cf --apply --force
timeout-minutes: 5
- name: load yaxunit
run: |
ibcmd.exe infobase config load --data=data --extension=YAXUNIT --force binary\yaxunit.cfe
ibcmd.exe infobase config apply --data=data --extension=YAXUNIT --force
ibcmd.exe infobase config extension update --data=data --name=YAXUNIT --safe-mode=no --unsafe-action-protection=no
timeout-minutes: 5
- name: load tests
run: |
ibcmd.exe infobase config load --data=data --extension=tests --force binary\tests.cfe
ibcmd.exe infobase config apply --data=data --extension=tests --force
ibcmd.exe infobase config extension update --data=data --name=tests --safe-mode=no --unsafe-action-protection=no
timeout-minutes: 5
- name: create test-config
uses: DamianReeves/write-file-action@master
with:
path: unit.json
contents: |
{
"reportFormat": "jUnit",
"reportPath": "reports\\report.xml",
"closeAfterTests": true,
"exitCode": "exit-code.txt",
"logging": {
"console": true,
"file": "execute.log"
}
}
- name: Test
run: |
Start-Process ibsrv.exe -ArgumentList "--data=data"
Start-Process -NoNewWindow -PassThru -Wait 1cv8c.exe -ArgumentList '/WS "http://localhost:8314" /C"RunUnitTests=unit.json" /L ru /VL ${{ inputs.locale }} /DisableStartupDialogs /DisableStartupMessages /DisableUnrecoverableErrorMessage /Out 1cv8c-output.log'
timeout-minutes: 10
- name: view output
if: always()
run: type execute.log
- name: view output
if: always()
run: type 1cv8c-output.log
- name: upload-artifact
uses: actions/upload-artifact@v3
with:
name: Tests report. Windows ${{ inputs.v8_version }} ${{ inputs.locale }}
path: reports/
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
job_name: Tests Windows ${{ inputs.v8_version }} ${{ inputs.locale }}
check_name: Tests report. Windows ${{ inputs.v8_version }} ${{ inputs.locale }}
report_paths: reports/report.xml
fail_on_failure: ${{ inputs.fail_on_failure }}
require_passed_tests: true