2020-06-21 19:01:18 +03:00
|
|
|
# Runs on notable pushes to ci-windows, and weekly on master.
|
|
|
|
|
2020-07-11 18:23:43 +03:00
|
|
|
# Builds all modules optimised on windows,
|
|
|
|
# and uploads a binaries artifact.
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-18 03:17:41 +03:00
|
|
|
name: windows CI
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
on:
|
2020-03-17 02:30:14 +03:00
|
|
|
schedule:
|
2020-03-18 03:17:41 +03:00
|
|
|
- cron: "0 07 * * 0" # sunday midnight pacific
|
2020-06-07 19:37:53 +03:00
|
|
|
|
2020-03-06 21:54:00 +03:00
|
|
|
push:
|
2020-03-17 02:30:14 +03:00
|
|
|
branches: [ ci-windows ]
|
2020-03-06 21:54:00 +03:00
|
|
|
paths:
|
2020-03-18 03:17:41 +03:00
|
|
|
- '.github/workflows/windows.yml'
|
2020-03-12 18:15:32 +03:00
|
|
|
- 'stack*.yaml'
|
|
|
|
- 'hledger-lib/**'
|
|
|
|
- 'hledger/**'
|
|
|
|
- 'hledger-ui/**'
|
|
|
|
- 'hledger-web/**'
|
2021-01-12 22:01:41 +03:00
|
|
|
# - 'bin/*.hs'
|
2020-11-17 23:55:13 +03:00
|
|
|
# ignore changes to example files, though currently some func tests depend on them
|
|
|
|
- 'examples/**'
|
|
|
|
- '!**.journal'
|
|
|
|
- '!**.j'
|
|
|
|
- '!**.ledger'
|
|
|
|
- '!**.csv'
|
|
|
|
# ignore changes to doc source files
|
2020-11-17 21:57:42 +03:00
|
|
|
- '!**.m4'
|
2020-03-06 21:54:00 +03:00
|
|
|
- '!**.md'
|
|
|
|
- '!**.1'
|
|
|
|
- '!**.5'
|
|
|
|
- '!**.info'
|
|
|
|
- '!**.txt'
|
|
|
|
|
2021-07-04 03:51:17 +03:00
|
|
|
workflow_dispatch:
|
|
|
|
|
2020-11-17 23:55:13 +03:00
|
|
|
|
2020-03-06 21:54:00 +03:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: windows-latest
|
2021-07-21 12:06:34 +03:00
|
|
|
# defaults:
|
|
|
|
# run:
|
|
|
|
# shell: bash
|
2020-03-06 21:54:00 +03:00
|
|
|
steps:
|
|
|
|
|
2020-03-07 12:38:10 +03:00
|
|
|
- name: Check out
|
|
|
|
uses: actions/checkout@v2
|
2021-06-04 11:44:46 +03:00
|
|
|
# have to fetch everything for git describe for --version
|
2021-06-04 11:49:39 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-06-04 11:51:17 +03:00
|
|
|
|
2021-07-14 00:36:26 +03:00
|
|
|
# keep synced in all workflows which do this
|
ci: run commitlint to check commits (#1602)
As first step in our main "check" workflows (push, linux, mac,
windows), check all the commit messages with commitlint.
These workflows can be triggered in various ways:
pull requests, pushes, manually, or scheduled.
For (each push to) a pull request, all commits currently in the PR
branch are checked.
For a regular push, all the pushed commits are checked, usually.
Subcases: push to master, push to other branch, force push;
I think at least the first two work, I don't care to spend more time
on it.
For a manual run, it seemed to check the same commits as a push (which
push ? Not sure how this works).
For a scheduled run - we'll see.
2021-07-09 10:35:14 +03:00
|
|
|
- name: Check commit messages
|
2021-07-14 00:36:26 +03:00
|
|
|
# For a PR, the range will be: master..origin/$GITHUB_HEAD_REF
|
|
|
|
# For a push it will be: $BEFORE..
|
|
|
|
# For a force push, BEFORE is the previous HEAD, and on github (though not locally) this is an "invalid revision range".
|
2021-11-23 05:37:32 +03:00
|
|
|
# In this and any case where the range is invalid, we'll just skip the check, to avoid false positives
|
2021-07-14 00:36:26 +03:00
|
|
|
# related: https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
|
ci: run commitlint to check commits (#1602)
As first step in our main "check" workflows (push, linux, mac,
windows), check all the commit messages with commitlint.
These workflows can be triggered in various ways:
pull requests, pushes, manually, or scheduled.
For (each push to) a pull request, all commits currently in the PR
branch are checked.
For a regular push, all the pushed commits are checked, usually.
Subcases: push to master, push to other branch, force push;
I think at least the first two work, I don't care to spend more time
on it.
For a manual run, it seemed to check the same commits as a push (which
push ? Not sure how this works).
For a scheduled run - we'll see.
2021-07-09 10:35:14 +03:00
|
|
|
env:
|
|
|
|
BEFORE: ${{ github.event.before }}
|
2021-11-15 04:49:04 +03:00
|
|
|
NUM: 5
|
2021-07-21 12:06:34 +03:00
|
|
|
shell: bash
|
ci: run commitlint to check commits (#1602)
As first step in our main "check" workflows (push, linux, mac,
windows), check all the commit messages with commitlint.
These workflows can be triggered in various ways:
pull requests, pushes, manually, or scheduled.
For (each push to) a pull request, all commits currently in the PR
branch are checked.
For a regular push, all the pushed commits are checked, usually.
Subcases: push to master, push to other branch, force push;
I think at least the first two work, I don't care to spend more time
on it.
For a manual run, it seemed to check the same commits as a push (which
push ? Not sure how this works).
For a scheduled run - we'll see.
2021-07-09 10:35:14 +03:00
|
|
|
run: |
|
2021-07-14 00:36:26 +03:00
|
|
|
RANGE=${BEFORE:-origin/master}..${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF}
|
|
|
|
git rev-list --quiet $RANGE \
|
|
|
|
&& bin/commitlint $RANGE \
|
2021-11-23 05:37:32 +03:00
|
|
|
|| ( echo "could not identify commits, not checking them" )
|
|
|
|
# || ( echo "could not identify commits, checking last $NUM instead:"; bin/commitlint -$NUM )
|
ci: run commitlint to check commits (#1602)
As first step in our main "check" workflows (push, linux, mac,
windows), check all the commit messages with commitlint.
These workflows can be triggered in various ways:
pull requests, pushes, manually, or scheduled.
For (each push to) a pull request, all commits currently in the PR
branch are checked.
For a regular push, all the pushed commits are checked, usually.
Subcases: push to master, push to other branch, force push;
I think at least the first two work, I don't care to spend more time
on it.
For a manual run, it seemed to check the same commits as a push (which
push ? Not sure how this works).
For a scheduled run - we'll see.
2021-07-09 10:35:14 +03:00
|
|
|
|
2021-07-21 12:01:57 +03:00
|
|
|
- name: Skip remaining CI steps if latest commit message begins with ;
|
2021-08-29 21:10:09 +03:00
|
|
|
shell: bash
|
2021-07-21 12:01:57 +03:00
|
|
|
run: |
|
2021-08-19 06:39:31 +03:00
|
|
|
echo "git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog"
|
2021-08-19 10:47:01 +03:00
|
|
|
(git log -1 --pretty='%s' ${GITHUB_HEAD_REF:+origin/$GITHUB_HEAD_REF} >> $$.gitlog \
|
|
|
|
&& (grep -qE '^ *;' $$.gitlog || echo "CONTINUE=true" >> $GITHUB_ENV)) \
|
2021-08-19 21:55:44 +03:00
|
|
|
|| ( echo "could not identify commit range, continuing CI steps"; echo "CONTINUE=true" >> $GITHUB_ENV )
|
2021-07-21 12:01:57 +03:00
|
|
|
|
2020-06-06 23:49:58 +03:00
|
|
|
# things to be cached/restored:
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-07 14:35:19 +03:00
|
|
|
- name: Cache stack global package db
|
|
|
|
id: stack-global-package-db
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-07 14:22:44 +03:00
|
|
|
with:
|
|
|
|
path: C:\Users\runneradmin\AppData\Roaming\stack\
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-appdata-roaming-stack
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-07 14:22:44 +03:00
|
|
|
|
2020-03-07 14:51:38 +03:00
|
|
|
- name: Cache stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2
|
2020-03-07 14:35:19 +03:00
|
|
|
id: stack-programs-dir
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-06 21:54:00 +03:00
|
|
|
with:
|
2020-03-06 22:16:13 +03:00
|
|
|
path: C:\Users\runneradmin\AppData\Local\Programs\stack\
|
2020-03-07 13:50:26 +03:00
|
|
|
# which files signal a change in stack's global db ?
|
|
|
|
# **.yaml includes */package.yaml and stack.yaml* (too many), and hopefully no other changing yamls
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-appdata-local-programs-stack
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 22:41:27 +03:00
|
|
|
|
2020-03-06 21:54:00 +03:00
|
|
|
- name: Cache .stack-work
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-06 21:54:00 +03:00
|
|
|
with:
|
|
|
|
path: .stack-work
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-stack-work
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger-lib/.stack-work
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-06 21:54:00 +03:00
|
|
|
with:
|
|
|
|
path: hledger-lib/.stack-work
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-hledger-lib-stack-work
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger/.stack-work
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-06 21:54:00 +03:00
|
|
|
with:
|
|
|
|
path: hledger/.stack-work
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-hledger-stack-work
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger-ui/.stack-work
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-06 21:54:00 +03:00
|
|
|
with:
|
|
|
|
path: hledger-ui/.stack-work
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-hledger-ui-stack-work
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
- name: Cache hledger-web/.stack-work
|
2020-08-01 22:58:02 +03:00
|
|
|
uses: actions/cache@v2
|
2020-03-06 21:54:00 +03:00
|
|
|
with:
|
|
|
|
path: hledger-web/.stack-work
|
2020-07-11 18:23:43 +03:00
|
|
|
key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-hledger-web-stack-work
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-06-06 23:49:58 +03:00
|
|
|
# - name: showStuff
|
|
|
|
# shell: bash
|
|
|
|
# run: |
|
|
|
|
# ls -lFRa /c/users/runneradmin/appdata/roaming/stack
|
|
|
|
# ls -lFRa /c/users/runneradmin/appdata/local/programs/stack
|
|
|
|
|
|
|
|
# actions:
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-07 14:14:54 +03:00
|
|
|
# - name: Add stack local bin to PATH
|
|
|
|
# run: echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin"
|
2020-03-07 13:57:59 +03:00
|
|
|
|
2020-10-19 08:04:32 +03:00
|
|
|
# - name: Install stack
|
|
|
|
# shell: bash
|
|
|
|
# run: |
|
|
|
|
# mkdir -p ~/.local/bin
|
|
|
|
# export PATH=~/.local/bin:$PATH
|
|
|
|
# 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
|
|
|
|
# env:
|
|
|
|
# stack: ${{ matrix.plan.stack }}
|
|
|
|
|
2020-03-06 21:54:00 +03:00
|
|
|
- name: Install stack
|
2020-03-07 14:40:48 +03:00
|
|
|
#if: steps.stack-programs-dir.outputs.cache-hit != 'true'
|
|
|
|
# this step is needed to get stack.exe into PATH, for now
|
2020-03-06 21:54:00 +03:00
|
|
|
run: |
|
2020-10-19 08:45:25 +03:00
|
|
|
curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip
|
2020-10-19 08:18:48 +03:00
|
|
|
7z x stack.zip stack.exe
|
2020-10-19 08:04:32 +03:00
|
|
|
which stack
|
2020-10-19 08:45:25 +03:00
|
|
|
stack --version
|
2020-10-19 08:55:42 +03:00
|
|
|
which ./stack
|
|
|
|
./stack --version
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-03-06 22:24:26 +03:00
|
|
|
- name: Install GHC
|
2020-03-07 14:51:38 +03:00
|
|
|
# if: steps.stack-programs-dir.outputs.cache-hit != 'true'
|
2020-03-07 14:40:48 +03:00
|
|
|
# set PATH=C:\Users\runneradmin\AppData\Local\Programs\stack\local\bin;%PATH%
|
2020-03-06 22:24:26 +03:00
|
|
|
run: |
|
2020-11-15 20:38:35 +03:00
|
|
|
./stack --no-terminal setup --install-ghc
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 22:24:26 +03:00
|
|
|
|
2020-03-06 21:54:00 +03:00
|
|
|
# - name: Install shelltestrunner
|
2020-03-16 20:34:36 +03:00
|
|
|
## - export PATH=~/.local/bin:$PATH
|
2020-03-06 21:54:00 +03:00
|
|
|
# - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi
|
|
|
|
# - shelltest --version
|
|
|
|
|
|
|
|
- name: Install haskell deps
|
|
|
|
run: |
|
2020-11-15 20:38:35 +03:00
|
|
|
./stack --no-terminal build --only-dependencies
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2021-06-29 22:53:17 +03:00
|
|
|
# use whichever GHC is in default stack.yaml
|
|
|
|
|
2020-06-22 03:50:03 +03:00
|
|
|
- name: Build all hledger modules warning free, optimised and minimised
|
2020-03-07 14:22:44 +03:00
|
|
|
run: |
|
2020-11-15 20:38:35 +03:00
|
|
|
./stack --no-terminal install --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror
|
2020-06-22 03:50:03 +03:00
|
|
|
# --ghc-options=-split-sections doesn't work on windows, "too many sections"
|
2020-03-08 01:53:12 +03:00
|
|
|
# --pedantic
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-06 21:54:00 +03:00
|
|
|
|
|
|
|
# run hledger-lib/hledger functional tests, skipping the ones for addons
|
2020-03-16 20:34:36 +03:00
|
|
|
## - export PATH=~/.local/bin:$PATH
|
2020-12-28 23:44:53 +03:00
|
|
|
#- COLUMNS=80 stack exec -- shelltest --execdir -j16 hledger/test -x /_ -x /addons
|
2020-03-06 21:54:00 +03:00
|
|
|
|
2020-06-10 01:27:30 +03:00
|
|
|
# artifacts:
|
2020-04-02 00:14:02 +03:00
|
|
|
|
|
|
|
- name: Gather executables
|
2020-03-07 07:06:20 +03:00
|
|
|
run: |
|
2020-04-02 00:14:02 +03:00
|
|
|
mkdir tmp
|
|
|
|
cd tmp
|
|
|
|
mkdir hledger
|
|
|
|
cd hledger
|
|
|
|
copy C:\Users\runneradmin\AppData\Roaming\local\bin\hledger.exe .
|
|
|
|
copy C:\Users\runneradmin\AppData\Roaming\local\bin\hledger-web.exe .
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|
2020-03-07 07:24:59 +03:00
|
|
|
|
2020-06-26 04:01:03 +03:00
|
|
|
# XXX intermittent upload failures
|
2020-04-02 00:14:02 +03:00
|
|
|
- name: Create executables artifact
|
2020-06-09 01:24:13 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2020-03-07 07:06:20 +03:00
|
|
|
with:
|
2020-06-10 01:27:30 +03:00
|
|
|
name: hledger-windows
|
2020-04-02 00:14:02 +03:00
|
|
|
path: tmp/hledger
|
2021-07-21 12:01:57 +03:00
|
|
|
if: env.CONTINUE
|