<commit_before>name: Stack

on:
  push:
  pull_request:

jobs:
  build:
    name: Stack CI - Linux - ${{ matrix.resolver }} - ${{ matrix.yaml }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - resolver: lts-12
            ghc: 8.4.4
            yaml: stack.yaml
          - resolver: lts-12
            ghc: 8.4.4
            yaml: stack-master.yaml
          - resolver: lts-14
            ghc: 8.6.5
            yaml: stack-master.yaml
          - resolver: lts-16
            ghc: 8.8.4
            yaml: stack-master.yaml
          - resolver: lts-17
            ghc: 8.10.4
            yaml: stack.yaml
          - resolver: lts-17
            ghc: 8.10.4
            yaml: stack-master.yaml

    steps:
      - name: Clone project
        uses: actions/checkout@v2

      - name: Prepare apt sources
        run: |
          set -ex
          sudo add-apt-repository -y ppa:hvr/ghc
          sudo apt update -y

      - name: Install C dependencies
        run: |
          set -ex
          sudo apt install -y \
            libx11-dev \
            libxext-dev \
            libxft-dev \
            libxinerama-dev \
            libxrandr-dev \
            libxss-dev \
            #

      - name: Install GHC
        # use system ghc in stack, don't waste GH Actions cache space
        run: |
          set -ex
          sudo apt install -y ghc-${{ matrix.ghc }}
          echo /opt/ghc/${{ matrix.ghc }}/bin >> $GITHUB_PATH

      - name: Cache Haskell dependencies
        uses: actions/cache@v2
        with:
          path: ~/.stack
          key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(matrix.yaml) }}-${{ hashFiles('*.cabal') }}
          restore-keys: |
            ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(matrix.yaml) }}-
            ${{ runner.os }}-${{ matrix.resolver }}-

      - name: Build and test
        run: |
          set -ex
          stack test \
            --fast --no-terminal \
            --stack-yaml=${{ matrix.yaml }} \
            --resolver=${{ matrix.resolver }} --system-ghc<commit_msg>ci: Cache pantry (hackage metadata) separately<commit_after>name: Stack

on:
  push:
  pull_request:

jobs:
  build:
    name: Stack CI - Linux - ${{ matrix.resolver }} - ${{ matrix.yaml }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - resolver: lts-12
            ghc: 8.4.4
            yaml: stack.yaml
          - resolver: lts-12
            ghc: 8.4.4
            yaml: stack-master.yaml
          - resolver: lts-14
            ghc: 8.6.5
            yaml: stack-master.yaml
          - resolver: lts-16
            ghc: 8.8.4
            yaml: stack-master.yaml
          - resolver: lts-17
            ghc: 8.10.4
            yaml: stack.yaml
          - resolver: lts-17
            ghc: 8.10.4
            yaml: stack-master.yaml

    steps:
      - name: Clone project
        uses: actions/checkout@v2

      - name: Prepare apt sources
        run: |
          set -ex
          sudo add-apt-repository -y ppa:hvr/ghc
          sudo apt update -y

      - name: Install C dependencies
        run: |
          set -ex
          sudo apt install -y \
            libx11-dev \
            libxext-dev \
            libxft-dev \
            libxinerama-dev \
            libxrandr-dev \
            libxss-dev \
            #

      - name: Install GHC
        # use system ghc in stack, don't waste GH Actions cache space
        run: |
          set -ex
          sudo apt install -y ghc-${{ matrix.ghc }}
          echo /opt/ghc/${{ matrix.ghc }}/bin >> $GITHUB_PATH

      - name: Cache Haskell package metadata
        uses: actions/cache@v2
        with:
          path: ~/.stack/pantry
          key: stack-pantry-${{ runner.os }}

      - name: Cache Haskell dependencies
        uses: actions/cache@v2
        with:
          path: |
            ~/.stack/*
            !~/.stack/pantry
          key: stack-${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(matrix.yaml) }}-${{ hashFiles('*.cabal') }}
          restore-keys: |
            stack-${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(matrix.yaml) }}-
            stack-${{ runner.os }}-${{ matrix.resolver }}-

      - name: Build and test
        run: |
          set -ex
          stack test \
            --fast --no-terminal \
            --stack-yaml=${{ matrix.yaml }} \
            --resolver=${{ matrix.resolver }} --system-ghc
{'fraction_non_alphanumeric': 0.12788632326820604, 'fraction_numerical': 0.016207815275310834, 'mean_word_length': 1.233515121467526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1331401', 'n_tokens_mistral': 1484, 'n_tokens_neox': 1378, 'n_words': 337}