diff --git a/.github/workflows/binaries-mac-x64.yml b/.github/workflows/binaries-mac-x64.yml deleted file mode 100644 index ee8110b..0000000 --- a/.github/workflows/binaries-mac-x64.yml +++ /dev/null @@ -1,141 +0,0 @@ -# Runs on any push or pr, and weekly on main. -# Produces optimised mac binaries and runs unit/doc/functional tests, -# using the default stack.yaml's GHC version. - -name: binaries-mac-x64 -env: - CONTINUE: true - -on: - schedule: - - cron: "0 07 * * 0" # sunday midnight pacific - push: - branches: [ main ] - pull_request: - branches: [ main ] - workflow_dispatch: - -jobs: - build: - 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=stack.yaml" } - - steps: - - - name: Check out - uses: actions/checkout@v3 - # have to fetch everything for git describe for --version - with: - fetch-depth: 0 - - - name: Check embedded files - run: | - brew install ripgrep - tools/checkembeddedfiles - if: env.CONTINUE - - # things to be cached/restored: - - - name: Cache stack global package db - id: stack-global - uses: actions/cache@v3 - with: - path: ~/.stack - key: ${{ runner.os }}-stack-global-from20220817-${{ hashFiles('**.yaml') }} - restore-keys: | - ${{ runner.os }}-stack-global-from20220817 - if: env.CONTINUE - - - name: Cache stack-installed programs in ~/.local/bin - id: stack-programs - uses: actions/cache@v3 - with: - path: ~/.local/bin - key: ${{ runner.os }}-stack-programs-from20220817-${{ hashFiles('**.yaml') }} - restore-keys: | - ${{ runner.os }}-stack-programs-from20220817 - if: env.CONTINUE - - - name: Cache .stack-work - uses: actions/cache@v3 - with: - path: .stack-work - key: ${{ runner.os }}-stack-work-from20230907-${{ hashFiles('**.yaml') }} - restore-keys: | - ${{ runner.os }}-stack-work-from20230907 - if: env.CONTINUE - - - name: Install stack - run: | - mkdir -p ~/.local/bin - export PATH=~/.local/bin:$PATH - if [[ ! -x ~/.local/bin/stack ]]; then brew install gnu-tar; curl -sL https://get.haskellstack.org/stable/osx-x86_64.tar.gz | gtar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'; chmod a+x ~/.local/bin/stack; fi - stack --version - if: env.CONTINUE - - - name: Install GHC (with stack) - env: - stack: ${{ matrix.plan.stack }} - run: | - $stack setup --install-ghc - if: env.CONTINUE - - # - 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 - # if: env.CONTINUE - - # - name: Install GHC (from haskell.org) - # run: | - # curl -sL https://downloads.haskell.org/~ghc/9.2.4/ghc-9.2.4-x86_64-apple-darwin.tar.xz | tar xj && cd ghc-9.2.4-x86_64-apple-darwin && ./configure && make install - # ghc --version - # mkdir -p ~/.stack && printf "system-ghc: true\ninstall-ghc: false\n" >>~/.stack/config.yaml - # if: env.CONTINUE - - - name: Install haskell deps - env: - stack: ${{ matrix.plan.stack }} - run: | - $stack build --test --only-dependencies --dry-run - $stack build --test --only-dependencies - if: env.CONTINUE - - - name: Build omnibus and test unit tests, doc tests - env: - stack: ${{ matrix.plan.stack }} - run: | - $stack install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror - # --ghc-options=-split-sections doesn't work on mac - # --pedantic - if: env.CONTINUE - - # artifacts: - - - name: Gather binaries - run: | - mkdir tmp - cd tmp - cp ~/.local/bin/omnibus . - strip omnibus - tar cvf omnibus-mac-x64.tar omnibus - if: env.CONTINUE - - # 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@v3 - with: - name: omnibus-mac-x64 - path: tmp/omnibus-mac-x64.tar - if: env.CONTINUE \ No newline at end of file diff --git a/.github/workflows/binaries-windows-x64.yml b/.github/workflows/binaries-windows-x64.yml deleted file mode 100644 index 3a4641f..0000000 --- a/.github/workflows/binaries-windows-x64.yml +++ /dev/null @@ -1,122 +0,0 @@ -# Runs on any push to main and PRs, along with weekly builds on main. -# Produces optimised windows binaries, -# using the default stack.yaml's GHC version. -# Currently runs no tests. -# Temporarily using nightly-2023-04-24 (ghc-9.4.4) to avoid https://gitlab.haskell.org/ghc/ghc/-/issues/23309 -# This actions script is lightly modified from hledger -# -# Not using nightly stackage here... - -name: binaries-windows-x64 -env: - CONTINUE: true - -on: - schedule: - - cron: "0 07 * * 0" # sunday midnight pacific - push: - branches: [ main ] - pull_request: - branches: [ main ] - workflow_dispatch: - - -jobs: - build: - runs-on: windows-latest - defaults: - run: - shell: bash - steps: - - - name: Check out - uses: actions/checkout@v3 - # have to fetch everything for git describe for --version - with: - fetch-depth: 0 - - - name: Confirm all remaining steps should run - run: echo "CONTINUE=true" >> $GITHUB_ENV - - # things to be cached/restored: - - - name: Cache stack global package db - id: stack-global-package-db - uses: actions/cache@v3 - with: - path: C:\Users\runneradmin\AppData\Roaming\stack\ - key: ${{ runner.os }}-appdata-roaming-stack-${{ hashFiles('**.yaml') }} - restore-keys: | - ${{ runner.os }}-appdata-roaming-stack - if: env.CONTINUE - - - name: Cache stack programs dir # ghc, ghc-included packages and their haddocks, mingw, msys2 - id: stack-programs-dir - uses: actions/cache@v3 - 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 - if: env.CONTINUE - - - name: Cache .stack-work - uses: actions/cache@v3 - with: - path: .stack-work - key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }} - restore-keys: | - ${{ runner.os }}-stack-work - if: env.CONTINUE - - # actions: - - - name: Install stack - run: | - curl -sL https://get.haskellstack.org/stable/windows-x86_64.zip -o stack.zip - 7z x stack.zip stack.exe - which stack - stack --version - which ./stack - ./stack --version - if: env.CONTINUE - - - name: Install GHC - run: | - ./stack --no-terminal setup --install-ghc - if: env.CONTINUE - - - name: Install haskell deps - run: | - ./stack --no-terminal build --only-dependencies --dry-run - ./stack --no-terminal build --only-dependencies - if: env.CONTINUE - - # use whichever GHC is in default stack.yaml - - - name: Build fits-parse, test it and build the omnibus CLI - run: | - ./stack --no-terminal install --test --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror - # --ghc-options=-split-sections doesn't work on windows, "too many sections" - # --pedantic - if: env.CONTINUE - - # artifacts: - - - name: Gather binaries - run: | - mkdir tmp - cd tmp - cp /C/Users/runneradmin/AppData/Roaming/local/bin/omnibus.exe . - strip omnibus.exe - if: env.CONTINUE - - - name: Create binaries artifact - uses: actions/upload-artifact@v3 - with: - name: omnibus-windows-x64 - path: | - tmp/omnibus.exe - if: env.CONTINUE \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bb5c3b7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +on: [push] +name: build +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + ghc: ['9.8.4'] + os: [ubuntu-latest, macOS-latest, windows-latest] + name: Haskell GHC ${{ matrix.ghc }} ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Setup Haskell + uses: haskell-actions/setup@v2 + with: + ghc-version: ${{ matrix.ghc }} + enable-stack: true + stack-no-global: true + stack-setup-ghc: true + - run: stack build + - run: stack test