From 50b45367dc995f16a966c15d3a58a87db0017b06 Mon Sep 17 00:00:00 2001 From: Andrii Danylchenko Date: Sat, 13 Jan 2024 13:50:47 +0200 Subject: [PATCH] Disable tests if no secret exists --- .github/workflows/github.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index 35019bdf7..0c3562dab 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -73,7 +73,6 @@ jobs: test: 0 preset: linux-clang-test - platform: linux - os: ubuntu-22.04 test: 1 preset: linux-gcc-test @@ -208,9 +207,9 @@ jobs: verbose: 2 - name: Clone Heroes 3 data - if: ${{ startsWith(matrix.preset, 'linux') && endsWith(matrix.preset, 'test') }} env: HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }} + if: ${{ env.HEROES_3_DATA_PASSWORD != '' && matrix.test == 1 }} run: | wget --progress=dot:giga https://github.com/vcmi-mods/vcmi-test-data/releases/download/v1.0/h3_assets.zip 7za x h3_assets.zip -p$HEROES_3_DATA_PASSWORD @@ -263,7 +262,9 @@ jobs: cmake --build --preset ${{matrix.preset}} - name: Test - if: ${{ matrix.test == 1 }} + env: + HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }} + if: ${{ env.HEROES_3_DATA_PASSWORD != '' && matrix.test == 1 }} run: | ctest --preset ${{matrix.preset}}