Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kleidukos/diff-package-api
Workflow to have golden tests on your Haskell package's API
https://github.com/kleidukos/diff-package-api
golden-test haskell stability
Last synced: 2 months ago
JSON representation
Workflow to have golden tests on your Haskell package's API
- Host: GitHub
- URL: https://github.com/kleidukos/diff-package-api
- Owner: Kleidukos
- Created: 2024-07-21T15:02:10.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-21T21:54:29.000Z (5 months ago)
- Last Synced: 2024-10-12T23:42:51.439Z (2 months ago)
- Topics: golden-test, haskell, stability
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# diff-package-api
## Usage
Install the appropriate version of [print-api](https://github.com/Kleidukos/print-api) in your development environment and build your project with GHC environment files enabled:
```bash
$ cabal build --write-ghc-environment-files=always
```Then produce the human-readable API summary with the command:
```bash
$ print-api -p
```And save the output to a file in the repository. You will track this file so that the workflow may compare
its results during CI with this canonical file.In your Workflow file, add the `--write-ghc-environment-files=always` option to your `cabal build` line, and after build and tests have passed, add:
```yaml
- name: Diff the expected and actual package APIs
uses: kleidukos/[email protected]
with:
package-name:
expected-interface:
ghc:
version: 0.1.0.1 # This is the version of the print-api tool
```If you use a job matrix, the value of the `ghc:` parameter may be `${{ matrix.ghc }}`