From 495f13069f79fc33e96fa2c15ea29a87b7c239e4 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Sat, 6 Jan 2024 01:34:52 +0800 Subject: [PATCH] test: Skip run if debug enabled and OS not matched --- .github/workflows/test.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67a2470..a3d46ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,16 +32,17 @@ jobs: shell: [shell, shell-bin] runs-on: ${{ matrix.os }} steps: + - name: Skip run if debug enabled and OS not matched + if: >- + ${{ github.event_name == 'workflow_dispatch' && inputs.debug + && ! ((inputs.os == 'all' || inputs.os == matrix.os) && matrix.shell == 'shell') + }} + run: exit 1 - uses: actions/checkout@v3 - uses: azuwis/nix-action@main with: key: pianotrans-${{ matrix.shell }}-${{ hashFiles('flake.*', 'nix/**') }} - debug: >- - ${{ github.event_name == 'workflow_dispatch' - && inputs.debug - && matrix.shell == 'shell' - && (inputs.os == 'all'|| inputs.os == matrix.os) - }} + debug: ${{ github.event_name == 'workflow_dispatch' && inputs.debug }} credential: ${{ secrets.TTYD_CREDENTIAL }} - uses: cachix/cachix-action@v12 with: