Skip to content

Commit

Permalink
Unify workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
memowe committed Apr 29, 2024
1 parent 68c9c63 commit 7b9ee75
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 75 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/haddock-pages.yml

This file was deleted.

30 changes: 28 additions & 2 deletions .github/workflows/test.yml → .github/workflows/test-apidocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build and test
name: Build, Test, API Docs

on: [push, workflow_dispatch]

jobs:
test:
build_test_docs:
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -49,9 +49,35 @@ jobs:
- name: Run tests
run: cabal test --test-show-details=streaming

- name: Build API docs
run: cabal haddock --builddir=haddock_build --haddock-hyperlinked-source --haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs'

- name: Save cached dependencies
uses: actions/cache/save@v3
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Collect generated API docs
run: mv $(find haddock_build -wholename '*doc/html/trivialini' | head -n 1) haddock_html

- name: Store generated API docs as artifact
uses: actions/upload-artifact@v2
with:
path: haddock_html

deploy_docs:
needs: build_test_docs
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v2
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

**Ultra light weight ini file parser, written in Haskell**

[![Build and test](https://github.com/memowe/trivialini/actions/workflows/test.yml/badge.svg)](https://github.com/memowe/trivialini/actions/workflows/test.yml)
[![Publish API docs](https://github.com/memowe/trivialini/actions/workflows/haddock-pages.yml/badge.svg)](https://github.com/memowe/trivialini/actions/workflows/haddock-pages.yml)
[![Test & API Docs pipeline](https://github.com/memowe/trivialini/actions/workflows/test-apidocs.yml/badge.svg)](https://github.com/memowe/trivialini/actions/workflows/test-apidocs.yml)
[![API docs](https://img.shields.io/badge/Haddock-Documentation-8a80a8?style=flat&logo=haskell&logoColor=lightgray)](https://mirko.westermeier.de/trivialini/Trivialini.html)

## Overview
Expand Down

0 comments on commit 7b9ee75

Please sign in to comment.