Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache to build action and add docs action #35

Merged
merged 10 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ jobs:
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Cache Cabal
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
- name: Set up HLint
uses: haskell-actions/hlint-setup@v2
- name: Run HLint
Expand All @@ -42,7 +50,7 @@ jobs:
- name: Build project
run: cabal build
- name: Run tests
run: cabal test --test-show-details=direct --test-options "--color=always"

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
cabal test
--test-show-details=direct
--test-options "--color=always"
51 changes: 51 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: docs

on:
push:
branches: ["master"]
workflow_dispatch:

jobs:
docs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
ghc: ["8.10.7"]
cabal: ["3.6"]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Haskell
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Cache Cabal
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-docs-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: ${{ runner.os }}-docs-${{ env.cache-name }}-
- name: Install LLVM
run: sudo apt install -y llvm-9 llvm-9-dev
- name: Build docs
run: >
cabal haddock
--haddock-options="--ignore-all-exports"
--enable-documentation
--haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs'
--haddock-hyperlink-source
--haddock-options=--quickjump
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: ./dist-newstyle/build/x86_64-linux/ghc-${{ matrix.ghc }}/mini-ml-0.1.0.0/doc/html/mini-ml