mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 18:29:36 +03:00
;ci: cleanups
This commit is contained in:
parent
2354525f6d
commit
81f5bf02bb
9
.github/workflows/binaries-linux-arm32v7.yml
vendored
9
.github/workflows/binaries-linux-arm32v7.yml
vendored
@ -5,19 +5,12 @@
|
|||||||
# Slow, will probably time out.
|
# Slow, will probably time out.
|
||||||
|
|
||||||
name: binaries-linux-arm32v7
|
name: binaries-linux-arm32v7
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ binaries-linux-arm32v7 ]
|
branches: [ binaries-linux-arm32v7 ]
|
||||||
#tags:
|
|
||||||
# - '[0-9]+.[0-9]+'
|
|
||||||
# - '[0-9]+.[0-9]+-*'
|
|
||||||
# - '[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
# - '[0-9]+.[0-9]+.[0-9]+-*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
|
137
.github/workflows/binaries-linux-x64-stack.yml
vendored
Normal file
137
.github/workflows/binaries-linux-x64-stack.yml
vendored
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
# Runs on any push to binaries-linux-x64-stack.
|
||||||
|
# Like binaries-linux-x64.yml except it builds with stack instead of cabal.
|
||||||
|
|
||||||
|
name: binaries-linux-x64-stack
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ binaries-linux-x64-stack ]
|
||||||
|
workflow_dispatch:
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: alpine:latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
# have to fetch everything for git describe for --version
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# 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-20240417-${{ hashFiles('**.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-stack-global-20240417
|
||||||
|
|
||||||
|
- 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-20240417-${{ hashFiles('**.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-stack-programs-20240417
|
||||||
|
|
||||||
|
- name: process cache of .stack-work
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .stack-work
|
||||||
|
key: ${{ runner.os }}-stack-work-20240417-${{ hashFiles('**.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-stack-work-20240417
|
||||||
|
|
||||||
|
- 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-20240417-${{ hashFiles('hledger-lib/package.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hledger-lib-stack-work-20240417
|
||||||
|
|
||||||
|
- name: process cache of hledger/.stack-work
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: hledger/.stack-work
|
||||||
|
key: ${{ runner.os }}-hledger-stack-work-20240417-${{ hashFiles('hledger/package.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hledger-stack-work-20240417
|
||||||
|
|
||||||
|
- 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-20240417-${{ hashFiles('hledger-ui/package.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hledger-ui-stack-work-20240417
|
||||||
|
|
||||||
|
- 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-20240417-${{ hashFiles('hledger-web/package.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-hledger-web-stack-work-20240417
|
||||||
|
|
||||||
|
# actions:
|
||||||
|
|
||||||
|
- name: Install general tools with system package manager
|
||||||
|
run: |
|
||||||
|
apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static
|
||||||
|
|
||||||
|
# needed by stack, at least; do it here in case it matters for ghcup too
|
||||||
|
- name: Fix $HOME for following steps (workaround from https://github.com/actions/runner/issues/863)
|
||||||
|
run: |
|
||||||
|
apk --no-cache add sudo
|
||||||
|
echo "setting HOME=/root"
|
||||||
|
echo HOME=/root | sudo tee -a $GITHUB_ENV
|
||||||
|
|
||||||
|
- 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-linux-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
|
||||||
|
|
||||||
|
# --allow-different-user is needed because of #863 above (or because stack didn't notice we're in a docker container)
|
||||||
|
- name: Install GHC with stack
|
||||||
|
run: |
|
||||||
|
stack --allow-different-user setup --install-ghc
|
||||||
|
|
||||||
|
- name: Build with stack
|
||||||
|
run: |
|
||||||
|
stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger # || (echo "ERROR: building hledger failed"; false)
|
||||||
|
stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false)
|
||||||
|
stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-web # || (echo "ERROR: building hledger-web failed"; false)
|
||||||
|
|
||||||
|
- name: Run built-in unit tests
|
||||||
|
run: |
|
||||||
|
stack exec -- hledger test
|
||||||
|
|
||||||
|
- 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
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: hledger-linux-x64
|
||||||
|
path: tmp/hledger-linux-x64.tar
|
111
.github/workflows/binaries-linux-x64.yml
vendored
111
.github/workflows/binaries-linux-x64.yml
vendored
@ -1,20 +1,13 @@
|
|||||||
# Runs on any push to binaries-linux-x64 or binaries.
|
# Runs on any push to binaries-linux-x64 or binaries.
|
||||||
# Produces optimised static x64 linux binaries,
|
# Produces optimised static x64 linux binaries,
|
||||||
# using the GHC version below and (cabal or stack) and Alpine linux,
|
# using the GHC version below and cabal and Alpine linux,
|
||||||
# which provides the statically-linkable musl.
|
# which provides the statically-linkable musl.
|
||||||
|
|
||||||
name: binaries-linux-x64
|
name: binaries-linux-x64
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ binaries-linux-x64, binaries ]
|
branches: [ binaries-linux-x64, binaries ]
|
||||||
#tags:
|
|
||||||
# - '[0-9]+.[0-9]+'
|
|
||||||
# - '[0-9]+.[0-9]+-*'
|
|
||||||
# - '[0-9]+.[0-9]+.[0-9]+'
|
|
||||||
# - '[0-9]+.[0-9]+.[0-9]+-*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -47,77 +40,12 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cabal
|
${{ runner.os }}-cabal
|
||||||
|
|
||||||
# - name: process cache of stack global package db
|
|
||||||
# id: stack-global
|
|
||||||
# uses: actions/cache@v4
|
|
||||||
# with:
|
|
||||||
# path: ~/.stack
|
|
||||||
# key: ${{ runner.os }}-stack-global-20240417-${{ hashFiles('**.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-stack-global-20240417
|
|
||||||
|
|
||||||
# - 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-20240417-${{ hashFiles('**.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-stack-programs-20240417
|
|
||||||
|
|
||||||
# - name: process cache of .stack-work
|
|
||||||
# uses: actions/cache@v4
|
|
||||||
# with:
|
|
||||||
# path: .stack-work
|
|
||||||
# key: ${{ runner.os }}-stack-work-20240417-${{ hashFiles('**.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-stack-work-20240417
|
|
||||||
|
|
||||||
# - 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-20240417-${{ hashFiles('hledger-lib/package.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-hledger-lib-stack-work-20240417
|
|
||||||
|
|
||||||
# - name: process cache of hledger/.stack-work
|
|
||||||
# uses: actions/cache@v4
|
|
||||||
# with:
|
|
||||||
# path: hledger/.stack-work
|
|
||||||
# key: ${{ runner.os }}-hledger-stack-work-20240417-${{ hashFiles('hledger/package.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-hledger-stack-work-20240417
|
|
||||||
|
|
||||||
# - 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-20240417-${{ hashFiles('hledger-ui/package.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-hledger-ui-stack-work-20240417
|
|
||||||
|
|
||||||
# - 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-20240417-${{ hashFiles('hledger-web/package.yaml') }}
|
|
||||||
# restore-keys: |
|
|
||||||
# ${{ runner.os }}-hledger-web-stack-work-20240417
|
|
||||||
|
|
||||||
# actions:
|
# actions:
|
||||||
|
|
||||||
- name: Install general tools with system package manager
|
- name: Install general tools with system package manager
|
||||||
run: |
|
run: |
|
||||||
apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static
|
apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurses-static libffi-dev make xz tar perl zlib-dev zlib-static
|
||||||
|
|
||||||
# needed by stack, at least; do it here in case it matters for ghcup too
|
|
||||||
# - name: Fix $HOME for following steps (workaround from https://github.com/actions/runner/issues/863)
|
|
||||||
# run: |
|
|
||||||
# apk --no-cache add sudo
|
|
||||||
# echo "setting HOME=/root"
|
|
||||||
# echo HOME=/root | sudo tee -a $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Add .ghcup/bin to PATH for following steps
|
- name: Add .ghcup/bin to PATH for following steps
|
||||||
run: |
|
run: |
|
||||||
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
|
echo "$HOME/.ghcup/bin/" >> $GITHUB_PATH
|
||||||
@ -127,10 +55,6 @@ jobs:
|
|||||||
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --version
|
if [[ ! -x ~/.ghcup/bin/ghcup ]]; then mkdir -p ~/.ghcup/bin && curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ~/.ghcup/bin/ghcup && chmod +x ~/.ghcup/bin/ghcup; fi; printf "ghcup: "; ghcup --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
|
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
|
||||||
if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.10.3.0 && ~/.ghcup/bin/ghcup set cabal 3.10.3.0; fi; printf "cabal: "; cabal --version
|
if [[ ! -x ~/.ghcup/bin/cabal ]]; then ~/.ghcup/bin/ghcup install cabal 3.10.3.0 && ~/.ghcup/bin/ghcup set cabal 3.10.3.0; fi; printf "cabal: "; cabal --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
|
|
||||||
|
|
||||||
|
|
||||||
## build with cabal
|
|
||||||
|
|
||||||
- name: Update cabal package index
|
- name: Update cabal package index
|
||||||
run: |
|
run: |
|
||||||
@ -154,39 +78,6 @@ jobs:
|
|||||||
strip hledger-web
|
strip hledger-web
|
||||||
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
|
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
|
||||||
|
|
||||||
## build with stack
|
|
||||||
# --allow-different-user is needed because of #863 above, or because stack didn't notice we're in a docker container
|
|
||||||
# failing with: /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld.gold: error: /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/crtbeginT.o: requires dynamic R_X86_64_32 reloc against '__TMC_END__' which may overflow at runtime; recompile with -fPIC
|
|
||||||
# TODO: try again now with alpine:latest
|
|
||||||
|
|
||||||
# - name: Install GHC with stack
|
|
||||||
# run: |
|
|
||||||
# stack --allow-different-user setup --install-ghc
|
|
||||||
|
|
||||||
# - name: Build with stack
|
|
||||||
# run: |
|
|
||||||
# stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger # || (echo "ERROR: building hledger failed"; false)
|
|
||||||
# stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-ui # || (echo "ERROR: building hledger-ui failed"; false)
|
|
||||||
# stack --allow-different-user build --ghc-options='-optl-static -fPIC' hledger-web # || (echo "ERROR: building hledger-web failed"; false)
|
|
||||||
|
|
||||||
# - name: Run built-in unit tests
|
|
||||||
# run: |
|
|
||||||
# stack exec -- hledger test
|
|
||||||
|
|
||||||
# - 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.
|
# 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.
|
# 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.
|
# Unfortunately it means users must both unzip and untar.
|
||||||
|
25
.github/workflows/binaries-mac-arm64.yml
vendored
25
.github/workflows/binaries-mac-arm64.yml
vendored
@ -3,42 +3,17 @@
|
|||||||
# using the default stack.yaml's GHC version.
|
# using the default stack.yaml's GHC version.
|
||||||
|
|
||||||
name: binaries-mac-arm64
|
name: binaries-mac-arm64
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Avoid, because these run in all forks also.
|
|
||||||
# jobs:
|
|
||||||
# job_id:
|
|
||||||
# if: github.event.pull_request.head.repo.full_name == github.repository
|
|
||||||
# schedule:
|
|
||||||
# - cron: "0 07 * * 0" # sunday midnight pacific
|
|
||||||
|
|
||||||
push:
|
push:
|
||||||
branches: [ binaries-mac-arm64, binaries ]
|
branches: [ binaries-mac-arm64, binaries ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# arm64
|
# arm64
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
# strategy:
|
|
||||||
# fail-fast: false
|
|
||||||
# matrix:
|
|
||||||
# plan:
|
|
||||||
# # - { ghc: "810" , stack: "stack --stack-yaml=stack8.10.yaml" }
|
|
||||||
# # XXX func tests in bin should be run only with GHC 8.10 for now (see shelltest below) (?)
|
|
||||||
# # - { ghc: "90" , stack: "stack --stack-yaml=stack9.0.yaml" }
|
|
||||||
# # - { ghc: "92" , stack: "stack --stack-yaml=stack9.2.yaml" }
|
|
||||||
# # - { ghc: "94" , stack: "stack --stack-yaml=stack9.4.yaml" }
|
|
||||||
# # - { ghc: "96" , stack: "stack --stack-yaml=stack9.6.yaml" }
|
|
||||||
# - { ghc: "98" , stack: "stack --stack-yaml=stack.yaml" }
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ghc: 98
|
ghc: 98
|
||||||
stack: stack
|
stack: stack
|
||||||
# declare this to prevent "Context access might be invalid" warnings below
|
|
||||||
CONTINUE:
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out
|
- name: Check out
|
||||||
|
25
.github/workflows/binaries-mac-x64.yml
vendored
25
.github/workflows/binaries-mac-x64.yml
vendored
@ -3,42 +3,17 @@
|
|||||||
# using the default stack.yaml's GHC version.
|
# using the default stack.yaml's GHC version.
|
||||||
|
|
||||||
name: binaries-mac-x64
|
name: binaries-mac-x64
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Avoid, because these run in all forks also.
|
|
||||||
# jobs:
|
|
||||||
# job_id:
|
|
||||||
# if: github.event.pull_request.head.repo.full_name == github.repository
|
|
||||||
# schedule:
|
|
||||||
# - cron: "0 07 * * 0" # sunday midnight pacific
|
|
||||||
|
|
||||||
push:
|
push:
|
||||||
branches: [ binaries-mac-x64, binaries ]
|
branches: [ binaries-mac-x64, binaries ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
# x64
|
# x64
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
|
|
||||||
# strategy:
|
|
||||||
# fail-fast: false
|
|
||||||
# matrix:
|
|
||||||
# plan:
|
|
||||||
# # - { ghc: "810" , stack: "stack --stack-yaml=stack8.10.yaml" }
|
|
||||||
# # XXX func tests in bin should be run only with GHC 8.10 for now (see shelltest below) (?)
|
|
||||||
# # - { ghc: "90" , stack: "stack --stack-yaml=stack9.0.yaml" }
|
|
||||||
# # - { ghc: "92" , stack: "stack --stack-yaml=stack9.2.yaml" }
|
|
||||||
# # - { ghc: "94" , stack: "stack --stack-yaml=stack9.4.yaml" }
|
|
||||||
# # - { ghc: "96" , stack: "stack --stack-yaml=stack9.6.yaml" }
|
|
||||||
# - { ghc: "98" , stack: "stack --stack-yaml=stack.yaml" }
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ghc: 944
|
ghc: 944
|
||||||
stack: stack --stack-yaml=stack9.4.yaml
|
stack: stack --stack-yaml=stack9.4.yaml
|
||||||
# declare this to prevent "Context access might be invalid" warnings below
|
|
||||||
CONTINUE:
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out
|
- name: Check out
|
||||||
|
7
.github/workflows/binaries-windows-x64.yml
vendored
7
.github/workflows/binaries-windows-x64.yml
vendored
@ -4,17 +4,10 @@
|
|||||||
# Currently runs no tests.
|
# Currently runs no tests.
|
||||||
|
|
||||||
name: binaries-windows-x64
|
name: binaries-windows-x64
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Avoid, because these run in all forks also.
|
|
||||||
# schedule:
|
|
||||||
# - cron: "0 07 * * 0" # sunday midnight pacific
|
|
||||||
|
|
||||||
push:
|
push:
|
||||||
branches: [ binaries-windows-x64, binaries ]
|
branches: [ binaries-windows-x64, binaries ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
99
.github/workflows/ci.yml
vendored
99
.github/workflows/ci.yml
vendored
@ -1,33 +1,21 @@
|
|||||||
# The main hledger continuous integration test workflow.
|
# The main hledger continuous integration test workflow.
|
||||||
# Passing this is required for merging/pushing to master, per
|
# Builds all packages expecting no warnings, runs lots of tests,
|
||||||
# https://github.com/simonmichael/hledger/settings/branch_protection_rules/17386787
|
# and on success, saves the binaries as an artifact.
|
||||||
|
# Code must pass this successfully before it can be merged or pushed to master
|
||||||
|
# (https://github.com/simonmichael/hledger/settings/branch_protection_rules/17386787).
|
||||||
|
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
# When and where does this workflow run ?
|
|
||||||
on:
|
on:
|
||||||
# When manually triggered in github ui, it runs in master.
|
# When manually triggered in github ui, it runs in master.
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
# When there's a push to the ci branch, it runs in that branch.
|
||||||
# On this schedule, it runs in master.
|
# After it passes, those commits can be merged/pushed to master.
|
||||||
# schedule:
|
|
||||||
# - cron: "0 07 * * 0" # sunday midnight pacific
|
|
||||||
# Avoid, because these run in all forks also.
|
|
||||||
# Possible workaround; does it prevent wasteful startups ?
|
|
||||||
# https://github.com/orgs/community/discussions/26409#discussioncomment-3251818
|
|
||||||
# jobs:
|
|
||||||
# job_id:
|
|
||||||
# if: github.event.pull_request.head.repo.full_name == github.repository
|
|
||||||
|
|
||||||
# When there's a push to the ci branch, it runs there.
|
|
||||||
# After passing there it can be merged/pushed to master.
|
|
||||||
# (Don't use these branches for pull requests, or it will run twice,
|
# (Don't use these branches for pull requests, or it will run twice,
|
||||||
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/2)
|
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/2)
|
||||||
push:
|
push:
|
||||||
branches: [ ci ]
|
branches: [ ci ]
|
||||||
|
# When there's a pull request against master, it runs in the pull request's branch.
|
||||||
# When there's a pull request against master, it runs in the PR branch.
|
# After it passes, that branch can be merged/pushed to master.
|
||||||
# After passing there it can be merged/pushed to master.
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
# Uncomment to run it only for changes to these paths: (but that could prevent merging)
|
# Uncomment to run it only for changes to these paths: (but that could prevent merging)
|
||||||
@ -53,31 +41,14 @@ on:
|
|||||||
# - '!**.5'
|
# - '!**.5'
|
||||||
# - '!**.info'
|
# - '!**.info'
|
||||||
# - '!**.txt'
|
# - '!**.txt'
|
||||||
|
|
||||||
# What does it do ?
|
|
||||||
jobs:
|
jobs:
|
||||||
|
citest:
|
||||||
# Build all expecting no warnings and run unit/doc/functional/haddock/bench tests,
|
|
||||||
# with the platform(s) and GHC version(s) enabled below.
|
|
||||||
# On success, upload the binaries as a downloadable artifact.
|
|
||||||
ci:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
# strategy:
|
|
||||||
# fail-fast: false
|
|
||||||
# matrix:
|
|
||||||
# # keep synced with branch protection rules, see link above
|
|
||||||
# plan:
|
|
||||||
# # the oldest supported ghc, to check backward compatibility
|
|
||||||
# # - { ghc: "810", stack: "stack --stack-yaml=stack8.10.yaml" }
|
|
||||||
# - { ghc: "944", stack: "stack --stack-yaml=stack9.4.yaml" }
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
ghc: 944
|
ghc: 944
|
||||||
stack: stack --stack-yaml=stack9.4.yaml
|
stack: stack --stack-yaml=stack9.4.yaml
|
||||||
# declare this to prevent "Context access might be invalid" warnings below
|
# declare this to prevent "Context access might be invalid" warnings below
|
||||||
CONTINUE:
|
do-all:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out
|
- name: Check out
|
||||||
@ -86,7 +57,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Print debug output
|
- name: Print some context for troubleshooting
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
run: |
|
run: |
|
||||||
@ -138,14 +109,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
|
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
|
||||||
(git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog \
|
(git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog \
|
||||||
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)) \
|
&& (grep -qE '^ *;' $$.gitlog || echo "do-all=true" >> $GITHUB_ENV)) \
|
||||||
|| ( echo "could not identify commit range, continuing CI steps"; echo "CONTINUE=true" >> $GITHUB_ENV )
|
|| ( echo "could not identify commit range, continuing CI steps"; echo "do-all=true" >> $GITHUB_ENV )
|
||||||
|
|
||||||
- name: Check embedded files
|
- name: Check embedded files
|
||||||
run: |
|
run: |
|
||||||
sudo apt install -y ripgrep
|
sudo apt install -y ripgrep
|
||||||
tools/checkembeddedfiles
|
tools/checkembeddedfiles
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
# things to be cached/restored:
|
# things to be cached/restored:
|
||||||
|
|
||||||
@ -160,7 +131,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-stack-global-$ghc-${{ hashFiles('**.yaml') }}
|
key: ${{ runner.os }}-stack-global-$ghc-${{ hashFiles('**.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-stack-global-$ghc
|
${{ runner.os }}-stack-global-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Uncache stack-installed programs in ~/.local/bin
|
- name: Uncache stack-installed programs in ~/.local/bin
|
||||||
id: stack-programs
|
id: stack-programs
|
||||||
@ -170,7 +141,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-stack-programs-$ghc-${{ hashFiles('**.yaml') }}
|
key: ${{ runner.os }}-stack-programs-$ghc-${{ hashFiles('**.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-stack-programs-$ghc
|
${{ runner.os }}-stack-programs-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Uncache .stack-work
|
- name: Uncache .stack-work
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -179,7 +150,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-stack-work-$ghc-${{ hashFiles('**.yaml') }}
|
key: ${{ runner.os }}-stack-work-$ghc-${{ hashFiles('**.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-stack-work-$ghc
|
${{ runner.os }}-stack-work-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Uncache hledger-lib/.stack-work
|
- name: Uncache hledger-lib/.stack-work
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -188,7 +159,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-hledger-lib-stack-work-$ghc-${{ hashFiles('hledger-lib/package.yaml') }}
|
key: ${{ runner.os }}-hledger-lib-stack-work-$ghc-${{ hashFiles('hledger-lib/package.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-hledger-lib-stack-work-$ghc
|
${{ runner.os }}-hledger-lib-stack-work-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Uncache hledger/.stack-work
|
- name: Uncache hledger/.stack-work
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -197,7 +168,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-hledger-stack-work-$ghc-${{ hashFiles('hledger/package.yaml') }}
|
key: ${{ runner.os }}-hledger-stack-work-$ghc-${{ hashFiles('hledger/package.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-hledger-stack-work-$ghc
|
${{ runner.os }}-hledger-stack-work-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Uncache hledger-ui/.stack-work
|
- name: Uncache hledger-ui/.stack-work
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -206,7 +177,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-hledger-ui-stack-work-$ghc-${{ hashFiles('hledger-ui/package.yaml') }}
|
key: ${{ runner.os }}-hledger-ui-stack-work-$ghc-${{ hashFiles('hledger-ui/package.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-hledger-ui-stack-work-$ghc
|
${{ runner.os }}-hledger-ui-stack-work-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Uncache hledger-web/.stack-work
|
- name: Uncache hledger-web/.stack-work
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@ -215,7 +186,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}-hledger-web-stack-work-$ghc-${{ hashFiles('hledger-web/package.yaml') }}
|
key: ${{ runner.os }}-hledger-web-stack-work-$ghc-${{ hashFiles('hledger-web/package.yaml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-hledger-web-stack-work-$ghc
|
${{ runner.os }}-hledger-web-stack-work-$ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
# actions:
|
# actions:
|
||||||
|
|
||||||
@ -226,21 +197,20 @@ jobs:
|
|||||||
# curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
|
# curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack
|
||||||
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
|
if [[ ! -x ~/.local/bin/stack ]]; then curl -sL https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi
|
||||||
stack --version
|
stack --version
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Install GHC
|
- name: Install GHC
|
||||||
run: |
|
run: |
|
||||||
$stack setup --install-ghc
|
$stack setup --install-ghc
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Install haskell deps
|
- name: Install haskell deps
|
||||||
run: |
|
run: |
|
||||||
$stack build --test --bench --only-dependencies --dry-run
|
$stack build --test --bench --only-dependencies --dry-run
|
||||||
$stack build --test --bench --only-dependencies
|
$stack build --test --bench --only-dependencies
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
# Packages are built one at a time to fail faster on error.
|
# Packages are built one at a time to fail faster on error.
|
||||||
# Note: doctests won't run if using GHC 9.0, see hledger-lib/package.yaml
|
|
||||||
# Takes ~2m on a 2023 github worker.
|
# Takes ~2m on a 2023 github worker.
|
||||||
- name: Build all hledger modules fast, warning free, run unit/doc/bench tests
|
- name: Build all hledger modules fast, warning free, run unit/doc/bench tests
|
||||||
run: |
|
run: |
|
||||||
@ -249,14 +219,14 @@ jobs:
|
|||||||
$stack install --fast --ghc-options=-Werror --test --bench hledger-ui
|
$stack install --fast --ghc-options=-Werror --test --bench hledger-ui
|
||||||
$stack install --fast --ghc-options=-Werror --test --bench hledger-web
|
$stack install --fast --ghc-options=-Werror --test --bench hledger-web
|
||||||
# --ghc-options=-split-sections --no-terminal
|
# --ghc-options=-split-sections --no-terminal
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
- name: Install shelltestrunner
|
- name: Install shelltestrunner
|
||||||
run: |
|
run: |
|
||||||
export PATH=~/.local/bin:$PATH
|
export PATH=~/.local/bin:$PATH
|
||||||
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.10; fi
|
if [[ ! -x ~/.local/bin/shelltest ]]; then $stack install shelltestrunner-1.10; fi
|
||||||
shelltest --version
|
shelltest --version
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
# Takes ~30s on a 2023 github worker.
|
# Takes ~30s on a 2023 github worker.
|
||||||
- name: Test functional tests (excluding addons)
|
- name: Test functional tests (excluding addons)
|
||||||
@ -264,10 +234,10 @@ jobs:
|
|||||||
export PATH=~/.local/bin:$PATH
|
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
|
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
|
||||||
# XXX run the bin/ func tests corresponding to the GHC version enabled above, only
|
# XXX run the bin/ func tests corresponding to the GHC version enabled above, only
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
# Takes 1m+ on a 2023 github worker.
|
# Takes 1m+ on a 2023 github worker.
|
||||||
# Moved to (one of) the binaries-* workflows instead;
|
# Moved to binaries-mac-arm64 workflow instead;
|
||||||
# haddock breakage might not be found until release time but it's easy to fix.
|
# haddock breakage might not be found until release time but it's easy to fix.
|
||||||
# - name: Test haddock generation
|
# - name: Test haddock generation
|
||||||
# env:
|
# env:
|
||||||
@ -277,7 +247,7 @@ jobs:
|
|||||||
# time $stack build --fast --haddock --no-haddock-deps --no-haddock-hyperlink-source --haddock-arguments="--no-print-missing-docs" || echo "HADDOCK FAILED, IGNORING"
|
# time $stack build --fast --haddock --no-haddock-deps --no-haddock-hyperlink-source --haddock-arguments="--no-print-missing-docs" || echo "HADDOCK FAILED, IGNORING"
|
||||||
# # --no-haddock-hyperlink-source is 25% faster
|
# # --no-haddock-hyperlink-source is 25% faster
|
||||||
# # --no-print-missing-docs is 600% quieter
|
# # --no-print-missing-docs is 600% quieter
|
||||||
# if: env.CONTINUE
|
# if: env.do-all
|
||||||
|
|
||||||
- name: Gather binaries
|
- name: Gather binaries
|
||||||
id: exes
|
id: exes
|
||||||
@ -291,10 +261,7 @@ jobs:
|
|||||||
strip hledger-ui
|
strip hledger-ui
|
||||||
strip hledger-web
|
strip hledger-web
|
||||||
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
|
tar cvf hledger-linux-x64.tar hledger hledger-ui hledger-web
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
# how to set a context variable, and an attempt to make a nice artifact version suffix:
|
|
||||||
# echo "::set-output name=version::$(git branch --show-current | sed 's/-.*//')-$(git rev-parse --short HEAD)"
|
|
||||||
|
|
||||||
# upload-artifact loses execute permissions, so we tar the binaries to preserve them.
|
# 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.
|
# github UI always zips artifacts when they are downloaded, so we don't bother compressing the tar.
|
||||||
@ -304,10 +271,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: hledger-linux-x64
|
name: hledger-linux-x64
|
||||||
path: tmp/hledger-linux-x64.tar
|
path: tmp/hledger-linux-x64.tar
|
||||||
if: env.CONTINUE
|
if: env.do-all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# snippets
|
||||||
|
|
||||||
|
# how to set a context variable, and an attempt to make a nice artifact version suffix:
|
||||||
|
# echo "::set-output name=version::$(git branch --show-current | sed 's/-.*//')-$(git rev-parse --short HEAD)"
|
||||||
|
|
||||||
# - name: show stuff
|
# - name: show stuff
|
||||||
# run: |
|
# run: |
|
||||||
|
Loading…
Reference in New Issue
Block a user