From ac2c0297ec48bcd6dca1fd5b5e3b200cd179fd79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Sun, 7 Jan 2024 12:32:18 +0100 Subject: [PATCH] Provide default value for version --- .github/workflows/ci.yml | 14 +++++++++++++- action.yml | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4965b7a..0028a8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: jobs: generate-matrix: name: "Generate matrix from cabal" - outputs: + outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} runs-on: ubuntu-latest steps: @@ -49,3 +49,15 @@ jobs: run: cabal new-build - name: Test run: cabal new-test all + test-generate-matrix-default: + name: "Tests whether generating the matrix from cabal works with a default version" + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + runs-on: ubuntu-latest + steps: + - name: Extract the tested GHC versions + id: set-matrix + uses: turion/get-tested@v0.1.6.0 + with: + cabal-file: get-tested.cabal + ubuntu: true diff --git a/action.yml b/action.yml index e4b9167..8dabf6f 100644 --- a/action.yml +++ b/action.yml @@ -35,7 +35,10 @@ runs: shell: bash run: | # Extract e.g. 0.1 from /runner/foo/bar/.../v0.1 - wget -q https://github.com/Kleidukos/get-tested/releases/download/v${{ inputs.version }}/get-tested-${{ inputs.version }}-linux-amd64 -O get-tested + export DEFAULT_VERSION=$(basename $GITHUB_ACTION_PATH | tail -c +2) + export VERSION=${{ inputs.version }} + VERSION=${:-} + wget -q https://github.com/Kleidukos/get-tested/releases/download/v$VERSION/get-tested-$VERSION-linux-amd64 -O get-tested chmod +x get-tested echo "::debug:: Windows enabled: ${{ inputs.windows }}"