Skip to content

Commit

Permalink
Implement OS selection (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleidukos authored Jan 6, 2024
1 parent a2c7ad4 commit 243f28f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ on:
jobs:
generate-matrix:
name: "Generate matrix from cabal"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
runs-on: ubuntu-latest
steps:
- name: Extract the tested GHC versions
uses: kleidukos/[email protected]
id: set-matrix
uses: kleidukos/get-tested@f111f862f481884c26faa691de3c51ae110cc766
with:
cabal-file: get-tested.cabal
ubuntu: true
version: 0.1.6.0
tests:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generate-matrix
Expand All @@ -27,7 +31,7 @@ jobs:
uses: actions/checkout@v4
- name: Set up Haskell
id: setup-haskell
uses: haskell/actions/setup@v2
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
Expand Down
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ inputs:
cabal-file:
description: "The path to your cabal file, e.g. somefolder/myproject.cabal"
required: true
version:
description: "Version of the tool"
required: true
windows:
description: "Enable Windows runner"
required: false
Expand Down Expand Up @@ -32,8 +35,7 @@ runs:
shell: bash
run: |
# Extract e.g. 0.1 from /runner/foo/bar/.../v0.1
export version=$(basename $GITHUB_ACTION_PATH | tail -c +2)
wget -q https://github.com/Kleidukos/get-tested/releases/download/v${version}/get-tested-${version}-linux-amd64 -O get-tested
wget -q https://github.com/Kleidukos/get-tested/releases/download/v${{ inputs.version }}/get-tested-${{ inputs.version }}-linux-amd64 -O get-tested
chmod +x get-tested
echo "::debug:: Windows enabled: ${{ inputs.windows }}"
Expand All @@ -55,7 +57,6 @@ runs:
id: set-matrix
shell: bash
run: |
./get-tested $WINDOWS $MACOS $UBUNTU ${{ inputs.cabal-file }}
./get-tested $WINDOWS $MACOS $UBUNTU ${{ inputs.cabal-file }} >> $GITHUB_OUTPUT
branding:
Expand Down

0 comments on commit 243f28f

Please sign in to comment.