-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build daily documentation snapshots and deploy them to GitHub Pages
- Loading branch information
0 parents
commit 9fa8f13
Showing
5 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: Stack | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 3 * * *' | ||
|
||
jobs: | ||
build: | ||
name: Stack CI - Linux - ${{ matrix.resolver }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- resolver: lts-17 | ||
ghc: 8.10.4 | ||
|
||
steps: | ||
- name: Clone project | ||
uses: actions/checkout@v2 | ||
|
||
- name: Clone X11 | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: xmonad/X11 | ||
path: X11 | ||
|
||
- name: Clone xmonad | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: xmonad/xmonad | ||
path: xmonad | ||
|
||
- name: Clone xmonad-contrib | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: xmonad/xmonad-contrib | ||
path: xmonad-contrib | ||
|
||
- name: Prepare apt sources | ||
run: | | ||
set -ex | ||
sudo add-apt-repository -y ppa:hvr/ghc | ||
sudo apt update -y | ||
- name: Install C dependencies | ||
run: | | ||
set -ex | ||
sudo apt install -y \ | ||
libx11-dev \ | ||
libxext-dev \ | ||
libxft-dev \ | ||
libxinerama-dev \ | ||
libxrandr-dev \ | ||
libxss-dev \ | ||
# | ||
- name: Install GHC | ||
# use system ghc in stack, don't waste GH Actions cache space | ||
run: | | ||
set -ex | ||
sudo apt install -y ghc-${{ matrix.ghc }} | ||
echo /opt/ghc/${{ matrix.ghc }}/bin >> $GITHUB_PATH | ||
- name: Refresh caches once a month | ||
id: cache-date | ||
# GHA writes caches on the first miss and then never updates them again; | ||
# force updating the cache at least once a month | ||
run: | | ||
echo "::set-output name=date::$(date +%Y-%m)" | ||
- name: Cache Haskell package metadata | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.stack/pantry | ||
key: stack-pantry-${{ runner.os }}-${{ steps.cache-date.outputs.date }} | ||
restore-keys: | | ||
stack-pantry-${{ runner.os }}- | ||
- name: Cache Haskell dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.stack/* | ||
!~/.stack/pantry | ||
key: stack-${{ runner.os }}-${{ matrix.resolver }}-${{ steps.cache-date.outputs.date }}-${{ hashFiles(matrix.yaml) }}-${{ hashFiles('*.cabal') }} | ||
restore-keys: | | ||
stack-${{ runner.os }}-${{ matrix.resolver }}-${{ steps.cache-date.outputs.date }}-${{ hashFiles(matrix.yaml) }}- | ||
stack-${{ runner.os }}-${{ matrix.resolver }}-${{ steps.cache-date.outputs.date }}- | ||
stack-${{ runner.os }}-${{ matrix.resolver }}- | ||
- name: Update hackage index | ||
# always update index to prevent the shared ~/.stack/pantry cache from being empty | ||
run: | | ||
set -ex | ||
stack update | ||
- name: Build documentation | ||
id: haddock | ||
run: | | ||
set -ex | ||
# workaround for stack/pantry caching of github archives | ||
sed -e "s/@{today}/@{$(date -u --iso-8601=seconds)}/" -i stack.yaml | ||
stack haddock \ | ||
--fast --no-terminal \ | ||
--resolver=${{ matrix.resolver }} --system-ghc | ||
read dir < <( | ||
stack path \ | ||
--local-doc-root \ | ||
--resolver=${{ matrix.resolver }} --system-ghc | ||
) | ||
echo "::set-output name=dir::$dir" | ||
touch "$dir"/.nojekyll | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages | ||
folder: ${{ steps.haddock.outputs.dir }} | ||
single-commit: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.stack-work/ | ||
/stack.yaml.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) The Xmonad Community | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
3. Neither the name of the author nor the names of his contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# xmonad-docs | ||
|
||
Daily snapshot of xmonad documentation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resolver: lts-16.31 | ||
|
||
packages: | ||
- X11 | ||
- xmonad | ||
- xmonad-contrib | ||
|
||
ghc-options: | ||
xmonad-contrib: '-j' |