<commit_before>name: Build

on:
  push:
  pull_request:

env:
  BUILDCACHE_VERSION: v0.27.0
  BUILDCACHE_ACCURACY: STRICT
  BUILDCACHE_MAX_CACHE_SIZE: 1073741824 # 1GiB

jobs:
  build-linux-x86_64:
    name: Build Linux (GCC x86_64)
    runs-on: ubuntu-20.04

    env:
      BUILDCACHE_DIR: ${{github.workspace}}/.buildcache

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive

      - name: Install dependencies
        run: |
          sudo apt-get -y update
          sudo apt-get -y install cmake ninja-build llvm-11-dev libclang-11-dev clang-11

          # setup buildcache
          curl -LSfs https://github.com/mbitsnbites/buildcache/releases/download/$BUILDCACHE_VERSION/buildcache-linux.tar.gz | tar xz -C "$RUNNER_WORKSPACE"
          echo "$RUNNER_WORKSPACE"/buildcache/bin >> $GITHUB_PATH

      - name: Restore buildcache
        uses: actions/cache@v2
        with:
          path: ${{env.BUILDCACHE_DIR}}
          key: buildcache-ubuntu-20.04-x86_64

      - name: Configure CMake
        run: |
          cmake -B build . -GNinja \
            -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
            -DATDNA_DYNAMIC_LLVM=OFF \
            -DClang_DIR:PATH=/usr/lib/cmake/clang-11 \
            -DCMAKE_C_COMPILER_LAUNCHER:STRING=buildcache \
            -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=buildcache

      - name: Build
        run: cmake --build build --target package --verbose

      - name: Print buildcache stats
        run: buildcache -s

      - name: Test
        working-directory: build
        run: ./atdna-test

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: atdna-linux-x86_64
          path: |
            build/athena-*.tar.gz

  build-linux-aarch64:
    name: Build Linux (GCC aarch64)
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive

      - uses: uraimo/run-on-arch-action@v2.0.9
        name: Build & test
        with:
          arch: aarch64
          distro: ubuntu20.04
          githubToken: ${{github.token}}
          dockerRunArgs: |
            --volume "${PWD}:/workspace"
          install: |
            apt-get -y update
            apt-get -y install build-essential cmake ninja-build llvm-11-dev libclang-11-dev clang-11
          run: |
            cmake -B build . -GNinja \
              -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
              -DATDNA_DYNAMIC_LLVM:BOOL=OFF \
              -DClang_DIR:PATH=/usr/lib/cmake/clang-11
            cmake --build build --target package --verbose
            build/atdna-test

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: atdna-linux-aarch64
          path: |
            build/athena-*.tar.gz

  build-macos-universal:
    name: Build macOS (AppleClang universal)
    runs-on: macos-10.15

    env:
      BUILDCACHE_DIR: ${{github.workspace}}/.buildcache

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive

      - name: Install dependencies
        run: |
          brew update<commit_msg>ci: Install zlib dev on Linux<commit_after>name: Build

on:
  push:
  pull_request:

env:
  BUILDCACHE_VERSION: v0.27.0
  BUILDCACHE_ACCURACY: STRICT
  BUILDCACHE_MAX_CACHE_SIZE: 1073741824 # 1GiB

jobs:
  build-linux-x86_64:
    name: Build Linux (GCC x86_64)
    runs-on: ubuntu-20.04

    env:
      BUILDCACHE_DIR: ${{github.workspace}}/.buildcache

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive

      - name: Install dependencies
        run: |
          sudo apt-get -y update
          sudo apt-get -y install cmake ninja-build llvm-11-dev libclang-11-dev clang-11 zlib1g-dev

          # setup buildcache
          curl -LSfs https://github.com/mbitsnbites/buildcache/releases/download/$BUILDCACHE_VERSION/buildcache-linux.tar.gz | tar xz -C "$RUNNER_WORKSPACE"
          echo "$RUNNER_WORKSPACE"/buildcache/bin >> $GITHUB_PATH

      - name: Restore buildcache
        uses: actions/cache@v2
        with:
          path: ${{env.BUILDCACHE_DIR}}
          key: buildcache-ubuntu-20.04-x86_64

      - name: Configure CMake
        run: |
          cmake -B build . -GNinja \
            -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
            -DATDNA_DYNAMIC_LLVM=OFF \
            -DClang_DIR:PATH=/usr/lib/cmake/clang-11 \
            -DCMAKE_C_COMPILER_LAUNCHER:STRING=buildcache \
            -DCMAKE_CXX_COMPILER_LAUNCHER:STRING=buildcache

      - name: Build
        run: cmake --build build --target package --verbose

      - name: Print buildcache stats
        run: buildcache -s

      - name: Test
        working-directory: build
        run: ./atdna-test

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: atdna-linux-x86_64
          path: |
            build/athena-*.tar.gz

  build-linux-aarch64:
    name: Build Linux (GCC aarch64)
    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive

      - uses: uraimo/run-on-arch-action@v2.0.9
        name: Build & test
        with:
          arch: aarch64
          distro: ubuntu20.04
          githubToken: ${{github.token}}
          dockerRunArgs: |
            --volume "${PWD}:/workspace"
          install: |
            apt-get -y update
            apt-get -y install build-essential cmake ninja-build llvm-11-dev libclang-11-dev clang-11 zlib1g-dev
          run: |
            cmake -B build . -GNinja \
              -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
              -DATDNA_DYNAMIC_LLVM:BOOL=OFF \
              -DClang_DIR:PATH=/usr/lib/cmake/clang-11
            cmake --build build --target package --verbose
            build/atdna-test

      - name: Upload artifacts
        uses: actions/upload-artifact@v2
        with:
          name: atdna-linux-aarch64
          path: |
            build/athena-*.tar.gz

  build-macos-universal:
    name: Build macOS (AppleClang universal)
    runs-on: macos-10.15

    env:
      BUILDCACHE_DIR: ${{github.workspace}}/.buildcache

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive

      - name: Install dependencies
        run: |
          brew update
{'fraction_non_alphanumeric': 0.09858505075361428, 'fraction_numerical': 0.02706859427868348, 'mean_word_length': 1.7625318606627018, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4246477', 'n_tokens_mistral': 2320, 'n_tokens_neox': 2129, 'n_words': 428}