Skip to content

Commit

Permalink
ci optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
alkoleft committed May 20, 2024
1 parent 8a207fb commit c30d0b7
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 34 deletions.
72 changes: 39 additions & 33 deletions .github/workflows/main-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Build and test
on:
push:
branches: [ feature/**, develop ]
branches:
- feature/**
- develop
tags:
- '*'
pull_request_target:
branches: [ develop ]

Expand All @@ -10,59 +14,61 @@ concurrency:
cancel-in-progress: true

permissions:
contents: read
contents: write
checks: write
id-token: write

jobs:
export_to_designer:
name: Export to designer xml
uses: ./.github/workflows/export-xml.yml
uses: ./.github/workflows/step-export-xml.yml
with:
edt_version: 2023.1.2
artifact_name: designer-src
secrets: inherit

build_artifacts:
name: Build artifacts
uses: ./.github/workflows/build-on-windows.yml
uses: ./.github/workflows/step-build-artifacts-windows.yml
needs: export_to_designer
with:
v8_version: 8.3.21.1895
secrets: inherit

tests_linux_ru:
name: Tests Linux 8.3.21.1895 ru_RU
uses: ./.github/workflows/run-tests-linux.yml
if: github.ref == 'refs/heads/develop'
needs: build_artifacts
with:
v8_version: 8.3.21.1895
secrets: inherit

tests_linux_en:
name: Tests Linux 8.3.21.1895 en_US
uses: ./.github/workflows/run-tests-linux.yml
if: github.ref == 'refs/heads/develop'

tests_windows:
strategy:
fail-fast: false
matrix:
v8_version:
- 8.3.21.1895
locale:
- ru_RU
- en_US
uses: ./.github/workflows/step-run-tests-windows.yml
needs: build_artifacts
with:
v8_version: 8.3.21.1895
locale: en_US
v8_version: ${{ matrix.v8_version }}
locale: ${{ matrix.locale }}
secrets: inherit

tests_windows_ru:
name: Tests Windows 8.3.21.1895 ru_RU
uses: ./.github/workflows/run-tests-windows.yml

tests_linux:
strategy:
fail-fast: false
matrix:
v8_version:
- 8.3.21.1895
locale:
- ru_RU
- en_US
uses: ./.github/workflows/step-run-tests-linux.yml
needs: build_artifacts
with:
v8_version: 8.3.21.1895
locale: ru_RU
v8_version: ${{ matrix.v8_version }}
locale: ${{ matrix.locale }}
secrets: inherit
tests_windows_en:
name: Tests Windows 8.3.21.1895 en_US
uses: ./.github/workflows/run-tests-windows.yml

publish_artifacts:
name: Publish draft release
if: ${{ startsWith(github.ref, 'refs/tags/') && success() }}
uses: ./.github/workflows/step-publish-artifacts.yml
needs: build_artifacts
with:
v8_version: 8.3.21.1895
locale: en_US
secrets: inherit
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
cancel-in-progress: true

jobs:
build:
export:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/step-publish-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run tests on Linux

on:
workflow_call:
inputs:
artifact_name:
type: string
required: false
default: build-artifacts

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
publish:
runs-on: ubuntu-latest
steps:

- name: download artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifact_name }}
path: binary
- name: Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: binary/YAxUnit.cfe
generate_release_notes: true
append_body: false
token: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
File renamed without changes.
42 changes: 42 additions & 0 deletions .github/workflows/step-run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run tests on Linux

on:
workflow_call:
inputs:

matrix:
description: 'Matrix parameters'
type: string
required: true

artifact_name:
type: string
required: false
default: build-artifacts

fail_on_failure:
type: boolean
required: false
default: true

permissions:
contents: read
checks: write
id-token: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.number }}
cancel-in-progress: true

jobs:
tests_windows:
uses: ./.github/workflows/step-run-tests-windows.yml
with:
matrix: ${{ inputs.matrix }}
secrets: inherit

tests_ubuntu:
uses: ./.github/workflows/step-run-tests-linux.yml
with:
matrix: ${{ inputs.matrix }}
secrets: inherit

0 comments on commit c30d0b7

Please sign in to comment.