;doc: update manuals #139
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
# Runs on any push to binaries-mac-x64 or binaries. | |
# Produces optimised mac x64 binaries and runs unit/doc/functional tests, | |
# using the default stack.yaml's GHC version. | |
name: binaries-mac-x64 | |
on: | |
push: | |
branches: [ binaries-mac-x64, binaries ] | |
workflow_dispatch: | |
jobs: | |
build: | |
# x64 | |
runs-on: macos-13 | |
env: | |
ghc: 98 | |
stack: stack | |
steps: | |
- name: Show platform info | |
run: | | |
arch | |
uname -a | |
- name: Check out | |
uses: actions/checkout@v4 | |
# have to fetch everything for git describe for --version | |
with: | |
fetch-depth: 0 | |
- name: Check embedded files | |
run: | | |
brew install ripgrep | |
tools/checkembeddedfiles | |
# things to be cached/restored: | |
- name: process cache of stack global package db | |
id: stack-global | |
uses: actions/cache@v4 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-stack-global-from20220817-${{ hashFiles('**.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-global-from20220817 | |
- name: process cache of stack-installed programs in ~/.local/bin | |
id: stack-programs | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/bin | |
key: ${{ runner.os }}-stack-programs-from20220817-${{ hashFiles('**.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-programs-from20220817 | |
- name: process cache of .stack-work | |
uses: actions/cache@v4 | |
with: | |
path: .stack-work | |
key: ${{ runner.os }}-stack-work-from20220817-${{ hashFiles('**.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-stack-work-from20220817 | |
- name: process cache of hledger-lib/.stack-work | |
uses: actions/cache@v4 | |
with: | |
path: hledger-lib/.stack-work | |
key: ${{ runner.os }}-hledger-lib-stack-work-from20220817-${{ hashFiles('hledger-lib/package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-hledger-lib-stack-work-from20220817 | |
- name: process cache of hledger/.stack-work | |
uses: actions/cache@v4 | |
with: | |
path: hledger/.stack-work | |
key: ${{ runner.os }}-hledger-stack-work-from20220817-${{ hashFiles('hledger/package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-hledger-stack-work-from20220817 | |
- name: process cache of hledger-ui/.stack-work | |
uses: actions/cache@v4 | |
with: | |
path: hledger-ui/.stack-work | |
key: ${{ runner.os }}-hledger-ui-stack-work-from20220817-${{ hashFiles('hledger-ui/package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-hledger-ui-stack-work-from20220817 | |
- name: process cache of hledger-web/.stack-work | |
uses: actions/cache@v4 | |
with: | |
path: hledger-web/.stack-work | |
key: ${{ runner.os }}-hledger-web-stack-work-from20220817-${{ hashFiles('hledger-web/package.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-hledger-web-stack-work-from20220817 | |
# actions: | |
- name: Add .ghcup/bin to PATH for following steps | |
run: | | |
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH | |
- name: Install haskell tools with ghcup if needed | |
run: | | |
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --version | |
if [[ ! -x ~/.ghcup/bin/stack ]]; then ~/.ghcup/bin/ghcup install stack 2.15.5 && ~/.ghcup/bin/ghcup set stack 2.15.5; fi; printf "stack: "; stack --version | |
#if [[ ! -x ~/.ghcup/bin/ghc-9.8.2 ]]; then ~/.ghcup/bin/ghcup install ghc 9.8.2 && ~/.ghcup/bin/ghcup set ghc 9.8.2; fi; printf "ghc: "; ghc --version | |
- name: Install GHC with stack | |
run: | | |
$stack setup --install-ghc | |
# - name: Install GHC (with ghcup) | |
# run: | | |
# mkdir -p ~/.ghcup/bin && curl -sL https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup | |
# ~/.ghcup/bin/ghcup install --set ghc 9.2.4 # && ~/.ghcup/bin/ghcup install stack | |
# echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH | |
- name: Install haskell deps | |
run: | | |
$stack build --test --only-dependencies --dry-run | |
$stack build --test --only-dependencies | |
- name: Build hledger and test unit tests, doc tests | |
run: | | |
$stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror | |
# --ghc-options=-split-sections doesn't work on mac | |
# --pedantic | |
- name: Install shelltestrunner | |
run: | | |
export PATH=~/.local/bin:$PATH | |
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.10; fi | |
shelltest --version | |
- name: Test functional tests (excluding addons) | |
run: | | |
export PATH=~/.local/bin:$PATH | |
COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-collected # bin | |
# artifacts: | |
- name: Gather binaries | |
run: | | |
mkdir tmp | |
cd tmp | |
cp ~/.local/bin/hledger . | |
cp ~/.local/bin/hledger-ui . | |
cp ~/.local/bin/hledger-web . | |
strip hledger | |
strip hledger-ui | |
strip hledger-web | |
tar cvf hledger-mac-x64.tar hledger hledger-ui hledger-web | |
# upload-artifact loses execute permissions, so we tar the binaries to preserve them. | |
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar. | |
# Unfortunately it means users must both unzip and untar. | |
- name: Upload binaries artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: hledger-mac-x64 | |
path: tmp/hledger-mac-x64.tar | |