From ecfd177d78eefeb2d47cec25f90eb73f647c37bb Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sat, 24 Feb 2024 15:31:49 +0100 Subject: [PATCH] Run tests in CI --- .github/actions/run-tests/action.yaml | 37 +++++++++++++++++++++++++++ .github/workflows/build-project.yaml | 13 ++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/actions/run-tests/action.yaml diff --git a/.github/actions/run-tests/action.yaml b/.github/actions/run-tests/action.yaml new file mode 100644 index 00000000..00576391 --- /dev/null +++ b/.github/actions/run-tests/action.yaml @@ -0,0 +1,37 @@ +name: "Run tests" +description: "Run tests." +inputs: + target: + description: "Build target" + required: true + workingDirectory: + description: "Working directory" + required: false + default: ${{ github.workspace }} +runs: + using: "composite" + steps: + - name: Run macOS tests + if: ${{ runner.os == 'macOS' }} + shell: zsh {0} + run: | + if [[ '${{ inputs.target }}' != 'macos-universal' ]]; then + echo tests skipped! + exit 0 + fi + ${{ inputs.workingDirectory }}/build_macos/tests/advanced-scene-switcher-tests + + - name: Run Linux packaging + if: ${{ runner.os == 'Linux' }} + shell: bash + run: | + if [[ '${{ inputs.target }}' != 'x86_64' ]]; then + exit 0 + fi + ${{ inputs.workingDirectory }}/build_x86_64/tests/advanced-scene-switcher-tests + + - name: Run Windows packaging + if: ${{ runner.os == 'Windows' }} + shell: pwsh + run: | + ${{ inputs.workingDirectory }}/build_x64/tests/RelWithDebInfo/advanced-scene-switcher-tests.exe diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 7f86678b..58d18c77 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -3,7 +3,7 @@ on: workflow_call: outputs: pluginName: - description: 'Project name detected by parsing build spec file' + description: "Project name detected by parsing build spec file" value: ${{ jobs.check-event.outputs.pluginName }} env: DEP_DIR: .deps/advss-build-dependencies @@ -110,7 +110,6 @@ jobs: print '::group::Select Xcode version' sudo xcode-select --switch /Applications/Xcode_14.3.1.app print '::endgroup::' - - uses: actions/cache@v4 id: ccache-cache @@ -220,6 +219,11 @@ jobs: target: x86_64 config: ${{ needs.check-event.outputs.config }} + - name: Run tests + uses: ./.github/actions/run-tests + with: + target: x86_64 + - name: Package Plugin 📀 uses: ./.github/actions/package-plugin with: @@ -287,6 +291,11 @@ jobs: target: x64 config: ${{ needs.check-event.outputs.config }} + - name: Run tests + uses: ./.github/actions/run-tests + with: + target: x64 + - name: Package Plugin 📀 uses: ./.github/actions/package-plugin with: