<commit_before>name: build-lint-test

on:
  pull_request:

env:
  LIBCURL_RELEASE: 'LATEST'

concurrency:
  group: ${{ github.head_ref }}
  cancel-in-progress: true

jobs:
  build-and-test:
    # this must match the matrix inside build-and-release.yaml
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - macos-10.15
          # removed as we enabled CircleCI to run on PRs
          # - ubuntu-16.04 # TODO(jonathan): bump this to a more recent version when we do a major version bump
        libcurl-release:
          - 7.73.0
        node:
          - 10
          - 12
          - 14
          - 16
        include:
          # we only want to run lint in one of the jobs
          - os: macos-10.15
            libcurl-release: 7.73.0
            node: 16
            run-lint-and-tsc: true
          # Node.js 16 needs a different cpp std
          - os: macos-10.15
            libcurl-release: 7.73.0
            node: 16
            node-libcurl-cpp-std: c++17
          # This is disabled as CircleCI is now running on PRs - we may add this back if build times are too slow with just CircleCI
          # - os: ubuntu-16.04
          #   libcurl-release: 7.73.0
          #   node: 16
          #   node-libcurl-cpp-std: c++17
          # we also want to build a job for old libcurl versions
          - os: macos-10.15
            libcurl-release: 7.50.0
            node: 16

    steps:
      - name: Checkout
        uses: actions/checkout@main
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node }}
      - run: echo "NODE_LIBCURL_CPP_STD=${{ matrix.node-libcurl-cpp-std }}" >> $GITHUB_ENV
        if: matrix.node-libcurl-cpp-std
      - if: runner.os == 'macOS'
        name: Install Needed packages on macOS
        run: brew install coreutils wget automake libtool cmake gnu-sed m4
      # not using brew for that one as we need 2.69
      - if: runner.os == 'macOS'
        name: Install autoconf
        run: |
          curl -O -L http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
          tar -xzf autoconf-2.69.tar.gz
          cd autoconf-*
          ./configure
          make
          make install
          autoconf --version
          ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
      - if: runner.os == 'Linux'
        name: Install Needed packages on Linux
        run: sudo apt-get install -y cmake
      - name: Output yarn cache dir
        id: yarn-cache-dir
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - name: Restore Yarn Cache
        uses: actions/cache@v1
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir.outputs.dir }}
          key: v1-${{ runner.os }}-yarn-cache-${{ github.ref }}-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            v1-${{ runner.os }}-yarn-cache-${{ github.ref }}-
            v1-${{ runner.os }}-yarn-cache-
      - name: Restore libcurl deps cache
        uses: actions/cache@v2
        id: libcurl-deps-cache
        with:
          path: |
            ~/.node-gyp
            ~/deps
          key: v3-${{ runner.os }}-libcurl-deps-cache-build-and-release
          restore-keys: |
            v3-${{ runner.os }}-libcurl-deps-cache-build-and-release
      - name: 'Install all the stuff'
        run: |
          RUN_TESTS=false \
          RUN_PREGYP_CLEAN=false \
          PUBLISH_BINARY=false \
            ./scripts/ci/build.sh
      # We could have used lerna to run only on changed here...
      - name: 'Run lint'
        run: yarn lint
        if: matrix.run-lint-and-tsc
      - name: 'Run tsc'
        run: yarn build:dist
        if: matrix.run-lint-and-tsc
      - name: 'Run tests'
        run: yarn test:coverage
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ./coverage/**
          fail_ci_if_error: false
      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: build-logs
          path: ./logs/
          retention-days: 3
<commit_msg>ci: use different cache key for build-lint-test workflow<commit_after>name: build-lint-test

on:
  pull_request:

env:
  LIBCURL_RELEASE: 'LATEST'

concurrency:
  group: ${{ github.head_ref }}
  cancel-in-progress: true

jobs:
  build-and-test:
    # this must match the matrix inside build-and-release.yaml
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - macos-10.15
          # removed as we enabled CircleCI to run on PRs
          # - ubuntu-16.04 # TODO(jonathan): bump this to a more recent version when we do a major version bump
        libcurl-release:
          - 7.73.0
        node:
          - 10
          - 12
          - 14
          - 16
        include:
          # we only want to run lint in one of the jobs
          - os: macos-10.15
            libcurl-release: 7.73.0
            node: 16
            run-lint-and-tsc: true
          # Node.js 16 needs a different cpp std
          - os: macos-10.15
            libcurl-release: 7.73.0
            node: 16
            node-libcurl-cpp-std: c++17
          # This is disabled as CircleCI is now running on PRs - we may add this back if build times are too slow with just CircleCI
          # - os: ubuntu-16.04
          #   libcurl-release: 7.73.0
          #   node: 16
          #   node-libcurl-cpp-std: c++17
          # we also want to build a job for old libcurl versions
          - os: macos-10.15
            libcurl-release: 7.50.0
            node: 16

    steps:
      - name: Checkout
        uses: actions/checkout@main
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node }}
      - run: echo "NODE_LIBCURL_CPP_STD=${{ matrix.node-libcurl-cpp-std }}" >> $GITHUB_ENV
        if: matrix.node-libcurl-cpp-std
      - if: runner.os == 'macOS'
        name: Install Needed packages on macOS
        run: brew install coreutils wget automake libtool cmake gnu-sed m4
      # not using brew for that one as we need 2.69
      - if: runner.os == 'macOS'
        name: Install autoconf
        run: |
          curl -O -L http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
          tar -xzf autoconf-2.69.tar.gz
          cd autoconf-*
          ./configure
          make
          make install
          autoconf --version
          ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
      - if: runner.os == 'Linux'
        name: Install Needed packages on Linux
        run: sudo apt-get install -y cmake
      - name: Output yarn cache dir
        id: yarn-cache-dir
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - name: Restore Yarn Cache
        uses: actions/cache@v1
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir.outputs.dir }}
          key: v1-${{ runner.os }}-yarn-cache-${{ github.ref }}-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            v1-${{ runner.os }}-yarn-cache-${{ github.ref }}-
            v1-${{ runner.os }}-yarn-cache-
      - name: Restore libcurl deps cache
        uses: actions/cache@v2
        id: libcurl-deps-cache
        with:
          path: |
            ~/.node-gyp
            ~/deps
          key: v3-build-lint-test-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}
          restore-keys: |
            v3-build-lint-test-${{ runner.os }}-libcurl-deps-cache-node-${{ matrix.node }}
      - name: 'Install all the stuff'
        run: |
          RUN_TESTS=false \
          RUN_PREGYP_CLEAN=false \
          PUBLISH_BINARY=false \
            ./scripts/ci/build.sh
      # We could have used lerna to run only on changed here...
      - name: 'Run lint'
        run: yarn lint
        if: matrix.run-lint-and-tsc
      - name: 'Run tsc'
        run: yarn build:dist
        if: matrix.run-lint-and-tsc
      - name: 'Run tests'
        run: yarn test:coverage
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          file: ./coverage/**
          fail_ci_if_error: false
      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: build-logs
          path: ./logs/
          retention-days: 3

{'fraction_non_alphanumeric': 0.1126610710485873, 'fraction_numerical': 0.020569807305828112, 'mean_word_length': 1.5451263537906137, 'pattern_counts': {'":': 2, '<': 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': '4764621', 'n_tokens_mistral': 2880, 'n_tokens_neox': 2678, 'n_words': 735}