Skip to content

Commit 628754a

Browse files
committed
Don't run when the GHC version is not supported
1 parent 9fc4e7d commit 628754a

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

action.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
description: "The file of the expected interface of the package. Generate it yourself with `print-api`."
1010
required: true
1111
ghc:
12-
description: "The version of GHC used to compile the project. See the project's README to know which versions are supported."
12+
description: "The version of GHC used to compile the project. See the project's README to know which versions are supported. If the version is not supported, it will not run."
1313
required: true
1414
version:
1515
description: "Version of the tool"
@@ -23,23 +23,18 @@ runs:
2323
- name: Set up the binary
2424
shell: bash
2525
run: |
26-
wget -q https://github.com/Kleidukos/print-api/releases/download/v0.0.1.0/print-api-0.1.0.0-Linux-static-x86_64.tar.gz
27-
tar -xzvf print-api-${{ inputs.version}}-Linux-static-x86_64.tar.gz
28-
chmod +x print-api
29-
30-
- name: Register the library in the package database
31-
shell: bash
32-
run: |
26+
if [[ ${{ inputs.ghc }} =~ ^(9.6.6|9.8.2|9.10.1)$ ]]
27+
then
28+
wget -q https://github.com/Kleidukos/print-api/releases/download/v0.0.1.0/print-api-0.1.0.0-Linux-static-x86_64.tar.gz
29+
tar -xzvf print-api-${{ inputs.version}}-Linux-static-x86_64.tar.gz
30+
chmod +x print-api
3331
cabal install -j ${{ inputs.package-name }}
34-
- name: Dump the actual version
35-
shell: bash
36-
run: |
37-
./print-api --package-name ${{ inputs.package-name }} --package-db=${{ inputs.package-database }} > actual-interface.txt
38-
- name: Perform the diff between the two versions
39-
shell: bash
40-
run: |
41-
diff ${{ inputs.expected-interface }} actual-interface.txt
42-
32+
./print-api --package-name ${{ inputs.package-name }} --package-db=${{ inputs.package-database }} > actual-interface.txt
33+
diff ${{ inputs.expected-interface }} actual-interface.txt
34+
else
35+
echo "GHC version not supported, not running."
36+
exit 0
37+
fi
4338
4439
branding:
4540
icon: 'list'

0 commit comments

Comments
 (0)