-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
43 lines (40 loc) · 1.62 KB
/
action.yml
File metadata and controls
43 lines (40 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: "Package Interface Diff"
description: "Ensure the stability of your package's API with golden testing"
inputs:
package-name:
description: "The package to test. Currently only one per project is supported"
required: true
expected-interface:
description: "The file of the expected interface of the package. Generate it yourself with `print-api`."
required: true
ghc:
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."
required: true
version:
description: "Version of the tool"
required: true
public-modules:
description: "Retain modules with the `Visibility` attribute in their Haddock documentation set to `Public`"
required: true
runs:
using: "composite"
steps:
- name: Set up the binary
shell: bash
run: |
if [[ ${{ inputs.ghc }} =~ ^(9.6.6|9.8.4|9.10.1)$ ]]
then
ARCHIVE=print-api-${{ inputs.version }}-Linux-static-${{ inputs.ghc }}-x86_64.tar.gz
wget -q https://github.com/Kleidukos/print-api/releases/download/v${{ inputs.version }}/$ARCHIVE
tar -xzvf $ARCHIVE
chmod +x print-api
[[ ${{ inputs.public-modules }} == "true" ]] && publicOnly="--public-only" || publicOnly=""
./print-api ${publicOnly} --package-name ${{ inputs.package-name }} > actual-interface.txt
diff ${{ inputs.expected-interface }} actual-interface.txt
else
echo "GHC version not supported, not running."
exit 0
fi
branding:
icon: 'list'
color: 'blue'