From b8d22bb7e5460c1ab1148bf8eacdeb553f052898 Mon Sep 17 00:00:00 2001 From: Marco Zocca Date: Sat, 17 Jun 2023 18:08:40 +0200 Subject: [PATCH] CI --- .github/workflows/haskell.yml | 146 ++++++++-------------------------- ms-graph-api.cabal | 6 +- 2 files changed, 38 insertions(+), 114 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 115210e..08a304e 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -8,122 +8,46 @@ on: defaults: { run: { shell: bash } } - +on: [push] jobs: - tests: - name: CI + build: + name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] - resolver: [nightly, lts-18, lts-16, lts-14, lts-12] - include: - - resolver: lts-12 - ghc: 8.4.4 - stack-yaml: stack.yaml - - resolver: lts-14 - stack-yaml: stack.yaml - - resolver: lts-16 - ghc: 8.8.4 - stack-yaml: stack.yaml - - resolver: lts-18 - ghc: 8.10.4 - - # Latest stable for MacOS: ghc-8.8.4 - - resolver: lts-16 - os: macos-latest - stack-yaml: stack.yaml - # Latest stable for Windows: ghc-8.6.4 - - resolver: lts-14 - os: windows-latest - stack-yaml: stack.yaml - - env: - STACK_YAML: stack.yaml - STACK_ARGS: '--resolver ${{ matrix.resolver }}' - cache-version: v1 # bump up this version to invalidate currently stored cache + ghc-version: ['9.6', '9.4', '9.2', '9.0', '8.10'] steps: - - uses: actions/checkout@v2 - - - name: Cache - id: cache - uses: actions/cache@v2 - if: matrix.os != 'macos-latest' - with: - path: | - ~/.stack - .stack-work - massiv-io/.stack-work - key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }} - restore-keys: | - ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }} - - name: Cache - id: cache-macos - uses: actions/cache@v2 - if: matrix.os == 'macos-latest' - with: - path: | - ~/.stack - key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }} - restore-keys: | - ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }} - - name: Workaround setup-exe-cache failure on macos - if: steps.cache-macos.outputs.cache-hit == 'true' && matrix.os == 'macos-latest' - run: | - rm -r ~/.stack/setup-exe-cache - - name: Windows Cache - id: cache-windows - uses: actions/cache@v2 - if: matrix.os == 'windows-latest' - with: - path: | - C:\\Users\\RUNNER~1\\AppData\\Roaming\\stack - C:\\Users\\RUNNER~1\\AppData\\Local\\Programs\\stack - key: ${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }} - restore-keys: | - ${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }} - - - name: Ubuntu install GHC - if: matrix.ghc != '' && matrix.os == 'ubuntu-latest' - run: | - sudo add-apt-repository ppa:hvr/ghc -y - sudo apt-get update - sudo apt-get install ghc-${{ matrix.ghc }} - - name: Install Stack and local GHC - run: | - set -ex - curl -sSL https://get.haskellstack.org/ | sh -s - -f - curl -sSL https://raw.githubusercontent.com/lehins/utils/786c3fe7e9e1345d7b403019f52e344627224edf/haskell/git-modtime/git-modtime.hs -o git-modtime.hs - [ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc" - [ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }} - stack $STACK_ARGS runghc git-modtime.hs - - name: Build - env: - COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - run: | - set -ex - [ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc" - [ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }} - if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-14" ] && [ -n "${COVERALLS_TOKEN}" ]; then - stack $STACK_ARGS build massiv-io:tests --coverage --test --no-run-tests --haddock --no-haddock-deps - else - stack $STACK_ARGS build --test --no-run-tests --bench --no-run-benchmarks --haddock --no-haddock-deps - fi - - name: Tests - env: - COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} - run: | - set -ex - [ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc" - [ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }} - if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-14" ] && [ -n "${COVERALLS_TOKEN}" ]; then - stack $STACK_ARGS test massiv-io:tests --coverage --haddock --no-haddock-deps - stack $STACK_ARGS hpc report --all - curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.6.1/shc-linux-x64-8.8.4.tar.bz2 | tar xj shc - ./shc --repo-token="$COVERALLS_TOKEN" --partial-coverage --fetch-coverage combined custom - else - stack $STACK_ARGS test massiv-io:doctests - stack $STACK_ARGS test massiv-io:tests - fi + - name: git checkout + uses: actions/checkout@v3 + - name: Setup Haskell tools + uses: haskell/actions/setup@v2 + with: + ghc-version: ${{ matrix.ghc-version }} + # cabal-version: 'latest'. Omitted, but defaults to 'latest' + enable-stack: true + stack-version: 'latest' + - name: Stack build and test + run: | + stack build + stack test + + # ci: + # name: CI + # runs-on: ubuntu-latest # or macOS-latest, or windows-latest + # steps: + # - name: git checkout + # uses: actions/checkout@v3 + # - name: Setup tools + # uses: haskell/actions/setup@v2 + # with: + # ghc-version: '8.8.4' # Exact version of ghc to use + # # cabal-version: 'latest'. Omitted, but defaults to 'latest' + # enable-stack: true + # stack-version: 'latest' + # - name: stack build and test + # run: | + # stack build + # stack test diff --git a/ms-graph-api.cabal b/ms-graph-api.cabal index 006d9c0..66e480b 100644 --- a/ms-graph-api.cabal +++ b/ms-graph-api.cabal @@ -1,5 +1,5 @@ name: ms-graph-api -version: 0.2.0.0 +version: 0.3.0.0 synopsis: Microsoft Graph API description: Bindings to the Microsoft Graph API homepage: https://github.com/unfoldml/ms-graph-api @@ -32,7 +32,7 @@ library , aeson , bytestring , containers - , hoauth2 + , hoauth2 >= 2.6.0 , http-client , http-conduit , http-types @@ -44,7 +44,7 @@ library , scotty , stm , text - , time + , time >= 1.8 , transformers >= 0.5 , unliftio , uri-bytestring