diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-nightly.yml similarity index 97% rename from .github/workflows/linux-ci.yml rename to .github/workflows/linux-nightly.yml index 2d6910e18..bf43d65c5 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-nightly.yml @@ -1,6 +1,5 @@ -# linux CI tests -# reasonably thorough build/test/benchmark/haddock/functest testing -# with stackage lts, run on master push/pull request +# reasonably thorough build/test/benchmark/haddock/functest testing, +# on linux, run nightly and also for pull requests # based on https://gist.github.com/mstksg/11f753d891cee5980326a8ea8c865233 # docs: @@ -17,12 +16,12 @@ # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # https://sevenzip.osdn.jp/chm/cmdline/commands/index.htm -name: linux CI +name: linux nightly/pr CI on: - # schedule: - # - cron: "0 23 * * *" - push: + schedule: + - cron: "0 23 * * *" + pull_request: branches: [ master ] paths: - 'stack*' @@ -36,7 +35,8 @@ on: - '!**.5' - '!**.info' - '!**.txt' - pull_request: + # uncomment when testing CI: + push: branches: [ master ] paths: - 'stack*' diff --git a/.github/workflows/mac-ci.yml b/.github/workflows/mac-nightly.yml similarity index 97% rename from .github/workflows/mac-ci.yml rename to .github/workflows/mac-nightly.yml index ae13280c0..10b48390a 100644 --- a/.github/workflows/mac-ci.yml +++ b/.github/workflows/mac-nightly.yml @@ -1,7 +1,6 @@ -# mac CI tests -# basic build testing, run nightly +# basic build testing on mac, run nightly -name: mac CI +name: mac nightly CI on: schedule: diff --git a/.github/workflows/quick.yml b/.github/workflows/quick.yml new file mode 100644 index 000000000..5cf563661 --- /dev/null +++ b/.github/workflows/quick.yml @@ -0,0 +1,112 @@ +# quick build and tests, on linux, for noteworthy pushes to master + +name: quick CI + +on: + push: + branches: [ master ] + paths: + - 'stack*' + - 'hledger-lib' + - 'hledger' + - 'hledger-ui' + - 'hledger-web' + - '.github/workflows/linux*' + - '!**.md' + - '!**.1' + - '!**.5' + - '!**.info' + - '!**.txt' + +jobs: + build: + runs-on: ubuntu-latest + steps: + + # cached things + + - name: Cache ~/.stack + uses: actions/cache@v1 + with: + path: ~/.stack + key: ${{ runner.os }}-stack + + - name: Cache ~/.local/bin + uses: actions/cache@v1 + with: + path: ~/.local/bin + key: ${{ runner.os }}-local-bin + + - name: Cache .stack-work + uses: actions/cache@v1 + with: + path: .stack-work + key: ${{ 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 + + - name: Cache hledger/.stack-work + uses: actions/cache@v1 + with: + path: hledger/.stack-work + key: ${{ 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 + + - name: Cache hledger-web/.stack-work + uses: actions/cache@v1 + with: + path: hledger-web/.stack-work + key: ${{ runner.os }}-hledger-web-stack-work + + # actions + + - name: Check out + uses: actions/checkout@v2 + + - name: Install stack + # curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C $INSTALLDIR '*/stack' + # mkdir -p ~/.local/bin + # export PATH=~/.local/bin:$PATH + # if [[ ! -x ~/.local/bin/stack ]]; then curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi + run: | + stack --version + + - name: Install GHC + run: | + stack --resolver=lts setup + + - name: Install shelltestrunner + run: | + export PATH=~/.local/bin:$PATH + if [[ ! -x ~/.local/bin/shelltest ]]; then stack --resolver=lts install shelltestrunner-1.9; fi + shelltest --version + + - name: Install haskell deps + run: | + stack --resolver=lts build --only-dependencies + # --no-terminal + + - name: Build hledger fast + run: | + stack --resolver=lts build --fast --ghc-options=-Werror + # --no-terminal + + - name: Unit & functional tests (excluding addons) + run: | + export PATH=~/.local/bin:$PATH + COLUMNS=80 stack --resolver=lts exec -- shelltest --execdir -j16 tests -x /bin -x /addons + +# - name: Configure +# if: startsWith(matrix.name, 'linux') +# run: | +# export PATH=/usr/local/bin:$PATH +# cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug ... diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-nightly.yml similarity index 96% rename from .github/workflows/windows-ci.yml rename to .github/workflows/windows-nightly.yml index a5abbef97..e7cb07aeb 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-nightly.yml @@ -1,7 +1,7 @@ -# windows CI tests -# basic hledger/hledger-web build testing, and binary building, run nightly +# basic hledger/hledger-web build testing, and binary building, +# on windows, run nightly -name: windows CI +name: windows nightly CI on: schedule: @@ -113,6 +113,7 @@ jobs: 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\ @@ -138,6 +139,7 @@ jobs: 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\