# basic hledger/hledger-web build testing, and binary building, # on windows, run nightly name: windows nightly CI on: # XXX not supported yet; build on noteworthy push to "ci" instead # schedule: # - cron: "0 23 * * *" # uncomment when testing CI: push: branches: [ ci, master ] # master too for testing paths: - '.github/workflows/windows-nightly.yml' - 'stack*' - 'hledger-lib' - 'hledger' - 'hledger-ui' - 'hledger-web' - '!**.md' - '!**.1' - '!**.5' - '!**.info' - '!**.txt' # pull_request: # branches: [ master ] # paths: # - 'stack*' # - 'hledger-lib' # - 'hledger' # - 'hledger-ui' # - 'hledger-web' # - '.github/workflows/windows*' # - '!**.md' # - '!**.1' # - '!**.5' # - '!**.info' # - '!**.txt' jobs: build: runs-on: windows-latest steps: - name: Check out uses: actions/checkout@v2 # - name: Show stuff # shell: bash # run: | # ls -lRF /C/Users/runneradmin/AppData/Local # # ls C:\Users\runneradmin\ # # ls C:\Users\runneradmin\AppData\ # # ls C:\Users\runneradmin\AppData\Local\ # # ls C:\Users\runneradmin\AppData\Local\Programs\ # # ls C:\Users\runneradmin\AppData\Local\Programs\stack # # ls C:\Users\runneradmin\AppData\Local\Programs\stack\x86_64-windows # # ls C:\Users\runneradmin\AppData\LocalLow\ # # ls C:\Users\runneradmin\AppData\Roaming\ # # ls C:\Users\runneradmin\AppData\Roaming\stack\ # ls C:\Users\runneradmin\AppData\Roaming\local\bin\ # ls C:\Users\runneradmin\AppData\Roaming\local\ # ls D:\a\hledger # ls D:\a # ls D:\ # declare/restore cached things - name: Cache stack global db # downloaded ghcs, package indexes, third-party haskell deps id: stack-global-db uses: actions/cache@v1 with: path: C:\Users\runneradmin\AppData\Local\Programs\stack\ # 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 key: ${{ runner.os }}-appdata-local-programs-stack-${{ hashFiles('**.yaml') }} restore-keys: ${{ runner.os }}-appdata-local-programs-stack - name: Cache stack local bin dir id: stack-local-bin-dir uses: actions/cache@v1 with: path: C:\Users\runneradmin\AppData\Roaming\stack\ key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }} restore-keys: ${{ runner.os }}-appdata-roaming-stack # stack's local package dbs for the project and each package - name: Cache .stack-work uses: actions/cache@v1 with: path: .stack-work key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }} restore-keys: ${{ runner.os }}-stack-work - name: Cache hledger-lib/.stack-work uses: actions/cache@v1 with: path: hledger-lib/.stack-work key: ${{ runner.os }}-hledger-lib-stack-work-${{ hashFiles('hledger-lib/package.yaml') }} restore-keys: ${{ runner.os }}-hledger-lib-stack-work - name: Cache hledger/.stack-work uses: actions/cache@v1 with: path: hledger/.stack-work key: ${{ runner.os }}-hledger-stack-work-${{ hashFiles('hledger/package.yaml') }} restore-keys: ${{ runner.os }}-hledger-stack-work - name: Cache hledger-ui/.stack-work uses: actions/cache@v1 with: path: hledger-ui/.stack-work key: ${{ runner.os }}-hledger-ui-stack-work-${{ hashFiles('hledger-ui/package.yaml') }} restore-keys: ${{ runner.os }}-hledger-ui-stack-work - name: Cache hledger-web/.stack-work uses: actions/cache@v1 with: path: hledger-web/.stack-work key: ${{ runner.os }}-hledger-web-stack-work-${{ hashFiles('hledger-web/package.yaml') }} restore-keys: ${{ runner.os }}-hledger-web-stack-work # actions # - name: Add stack local bin to PATH # run: echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin" - name: Install stack if: steps.stack-local-bin-dir.outputs.cache-hit != 'true' run: | curl -skL -o stack.zip http://www.stackage.org/stack/windows-x86_64 7z x stack.zip -oC:\Windows stack.exe stack --version - name: Install GHC if: steps.stack-global-db.outputs.cache-hit != 'true' # echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin" run: | C:\Users\runneradmin\AppData\Roaming\stack\local\bin\stack --no-terminal setup --install-ghc # - name: Install shelltestrunner # - if [[ ! -x ~/.local/bin/shelltest ]]; then stack install shelltestrunner-1.9; fi # - shelltest --version - name: Install haskell deps if: steps.stack-global-db.outputs.cache-hit != 'true' # echo "::add-path::C:\Users\runneradmin\AppData\Roaming\stack\local\bin" run: | C:\Users\runneradmin\AppData\Roaming\stack\local\bin\stack --no-terminal build --only-dependencies - name: Build hledger run: C:\Users\runneradmin\AppData\Roaming\stack\local\bin\stack --no-terminal install --ghc-options=-Werror # run hledger-lib/hledger functional tests, skipping the ones for addons #- COLUMNS=80 stack exec -- shelltest --execdir -j16 tests -x /bin -x /addons - name: Zip exes #cd `stack path --local-bin` run: | cd C:\Users\runneradmin\AppData\Roaming\local\bin\ 7z a D:\a\hledger\hledger\hledger.zip hledger.exe hledger-web.exe - name: Upload zip file uses: actions/upload-artifact@v1 with: name: hledger.zip path: hledger.zip # - name: Configure # if: startsWith(matrix.name, 'windows') # run: | # set PATH=C:\ProgramData\scoop\shims;%PATH% # call "${{ matrix.vcvarsall }}" x64 # Sets a whole bunch of environment variables used by the next call to cmake. # cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug ... # Same as above (duplicated)