<commit_before>name: Build toolchains
'on':
    push:
        branches:
            - master
        tags:
            - v*

jobs:
    ReleaseCreate:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
              with:
                  path: source
            - name: Checking branch
              run: echo "Currently received $GITHUB_REF"
            - name: Create release
              if: startsWith(github.ref, 'refs/tags/')
              working-directory: ${{ github.workspace }}/source
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: >
                  gh release create ${GITHUB_REF:10}
                  -R ${{ github.repository }}
                  -p
                  -t "Automatic Release ${GITHUB_REF:10}"
                  -n 'Automatically generated by Actions'
                  --target ${{ github.sha }}

    BuildCompilers:
        runs-on: ubuntu-latest
        needs: ReleaseCreate
        env:
            CTNG: '${{ github.workspace }}/crosstool-ng-master/ct-ng'
        strategy:
            matrix:
                system:
                    - name: beaglebone
                      arch: arm-unknown-linux-gnueabihf
                    - name: raspberry
                      arch: arm-unknown-linux-gnueabihf
                    - name: desktop
                      arch: x86_64-unknown-linux-gnu
        steps:
            - uses: actions/checkout@v2
              with:
                  path: source
            - name: Download dependencies
              run: sudo apt install -y build-essential flex bison help2man libtool-bin
            - name: Download crosstool-ng
              run: |
                  wget https://github.com/crosstool-ng/crosstool-ng/archive/master.tar.gz
                  tar xvf master.tar.gz
            - name: Install crosstool-ng
              working-directory: ${{ github.workspace }}/crosstool-ng-master
              run: |
                  ./bootstrap
                  ./configure --enable-local
                  make -j4
            - name: Build toolchain
              working-directory: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/compiler
              run: |
                  $CTNG build.4 -e CT_PREFIX=${{ github.workspace }}/build
                  chmod -R a+wx ${{github.workspace}}/build/${{matrix.system.arch}}
            - name: Add Beaglebone Black libs
              if: matrix.system.name == 'beaglebone'
              run: |
                  git clone https://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git sgx
                  cp -r sgx/targetfs/include/* ${{ github.workspace }}/build/${{matrix.system.arch}}/${{matrix.system.arch}}/sysroot/usr/include
                  cp sgx/targetfs/lib/lib* ${{ github.workspace }}/build/${{matrix.system.arch}}/${{matrix.system.arch}}/sysroot/usr/lib
                  cp sgx/targetfs/lib/pkgconfig/* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib/pkgconfig
                  cp -r sgx/targetfs/lib/gbm ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib
            - name: Add Raspberry Pi VideoCore IV libs
              if: matrix.system.name == 'raspberry'
              run: |
                  wget https://github.com/raspberrypi/firmware/archive/master.tar.gz -O rpi-firmware.tar.gz
                  tar xvf rpi-firmware.tar.gz
                  cp -r firmware-master/hardfp/opt/vc/include/* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/include
                  cp firmware-master/hardfp/opt/vc/lib/lib* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib
                  cp firmware-master/hardfp/opt/vc/lib/pkgconfig/* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib/pkgconfig
                  cp -r firmware-master/hardfp/opt/vc/lib/plugins ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib
            - name: Zip up toolchain
              working-directory: ${{ github.workspace }}/build/${{ matrix.system.arch }}
              run: |
                  tar Jcf ${{ github.workspace }}/${{ matrix.system.name }}-${{ matrix.system.arch }}.tar.xz *
            - name: Create toolchain artifact
              uses: actions/upload-artifact@v2
              with:
                  name: ${{ matrix.system.name }}-${{ matrix.system.arch }}
                  path: ${{ github.workspace }}/build/${{ matrix.system.arch }}
            - name: Upload to release
              if: startsWith(github.ref, 'refs/tags/')
              working-directory: ${{ github.workspace }}/source
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: >
                  gh release upload ${GITHUB_REF:10}
                  ${{ github.workspace }}/${{ matrix.system.name }}-${{ matrix.system.arch }}.tar.xz
                  -R ${{ github.repository }}
                  --clobber
            - name: Upload manifest
              if: startsWith(github.ref, 'refs/tags/')
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: |
                 grep '^CT_GCC_VERSION\|^CT_BINUTILS_VERSION\|^CT_GLIBC_VERSION\|^CT_LINUX_VERSION\|^CT_STRACE_VERSION\|^CT_GDB_VERSION' ${{github.workspace}}/source/toolchains/${{matrix.system.name}}-ct/compiler/.config | grep -v '^#' > ${{matrix.system.name}}-${{matrix.system.arch}}.manifest
                 gh release upload ${GITHUB_REF:10} ${{matrix.system.name}}-${{matrix.system.arch}}.manifest -R ${{github.repository}} --clobber
    BuildSysroot:
        runs-on: ubuntu-latest
        needs: BuildCompilers
        strategy:
            matrix:
                system:
                    - name: beaglebone
                      arch: arm-unknown-linux-gnueabihf
                      sysroot: wayland
                    - name: desktop
                      arch: x86_64-unknown-linux-gnu
                      sysroot: multi
        steps:
            - uses: actions/checkout@v2
              with:
                  path: source
            - name: Download dependencies
              run: sudo apt install -y build-essential flex bison help2man libtool-bin
            - name: Download compiler
              uses: actions/download-artifact@v2
              with:
                  name: ${{ matrix.system.name }}-${{ matrix.system.arch }}
                  path: ${{ github.workspace }}/source/toolchains/${{matrix.system.name}}-ct/compiler/${{ matrix.system.arch }}
            - name: Download buildroot
              uses: actions/checkout@v2
              with:
                  path: source/toolchains/${{ matrix.system.name }}-ct/sysroot
                  repository: buildroot/buildroot
                  ref: '2020.11.3'
            - name: Copy config
              run: >
                  cp
                  ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot.${{ matrix.system.sysroot }}.config
                  ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot/.config
            - name: Build sysroot
              working-directory: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot
              run: |
                  ls -l ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/compiler/${{ matrix.system.arch }}
                  make sdk
            - name: Upload sysroot
              uses: actions/upload-artifact@v2
              with:
                  name: ${{ matrix.system.name }}-${{ matrix.system.arch }}-${{ matrix.system.sysroot }}
                  path: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot/output/host
            - name: Zip up sysroot
              working-directory: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot/output/host
              run: |
                  tar Jcf ${{ github.workspace }}/${{ matrix.system.name }}-${{ matrix.system.arch }}_${{ matrix.system.sysroot }}.tar.xz *
            - name: Upload to release
              if: startsWith(github.ref, 'refs/tags/')
              working-directory: ${{ github.workspace }}/source
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: ><commit_msg> - Fix execution bit on toolchain<commit_after>name: Build toolchains
'on':
    push:
        branches:
            - master
        tags:
            - v*

jobs:
    ReleaseCreate:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2
              with:
                  path: source
            - name: Checking branch
              run: echo "Currently received $GITHUB_REF"
            - name: Create release
              if: startsWith(github.ref, 'refs/tags/')
              working-directory: ${{ github.workspace }}/source
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: >
                  gh release create ${GITHUB_REF:10}
                  -R ${{ github.repository }}
                  -p
                  -t "Automatic Release ${GITHUB_REF:10}"
                  -n 'Automatically generated by Actions'
                  --target ${{ github.sha }}

    BuildCompilers:
        runs-on: ubuntu-latest
        needs: ReleaseCreate
        env:
            CTNG: '${{ github.workspace }}/crosstool-ng-master/ct-ng'
        strategy:
            matrix:
                system:
                    - name: beaglebone
                      arch: arm-unknown-linux-gnueabihf
                    - name: raspberry
                      arch: arm-unknown-linux-gnueabihf
                    - name: desktop
                      arch: x86_64-unknown-linux-gnu
        steps:
            - uses: actions/checkout@v2
              with:
                  path: source
            - name: Download dependencies
              run: sudo apt install -y build-essential flex bison help2man libtool-bin
            - name: Download crosstool-ng
              run: |
                  wget https://github.com/crosstool-ng/crosstool-ng/archive/master.tar.gz
                  tar xvf master.tar.gz
            - name: Install crosstool-ng
              working-directory: ${{ github.workspace }}/crosstool-ng-master
              run: |
                  ./bootstrap
                  ./configure --enable-local
                  make -j4
            - name: Build toolchain
              working-directory: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/compiler
              run: |
                  $CTNG build.4 -e CT_PREFIX=${{ github.workspace }}/build
                  chmod -R a+wx ${{github.workspace}}/build/${{matrix.system.arch}}
            - name: Add Beaglebone Black libs
              if: matrix.system.name == 'beaglebone'
              run: |
                  git clone https://git.ti.com/git/graphics/omap5-sgx-ddk-um-linux.git sgx
                  cp -r sgx/targetfs/include/* ${{ github.workspace }}/build/${{matrix.system.arch}}/${{matrix.system.arch}}/sysroot/usr/include
                  cp sgx/targetfs/lib/lib* ${{ github.workspace }}/build/${{matrix.system.arch}}/${{matrix.system.arch}}/sysroot/usr/lib
                  cp sgx/targetfs/lib/pkgconfig/* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib/pkgconfig
                  cp -r sgx/targetfs/lib/gbm ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib
            - name: Add Raspberry Pi VideoCore IV libs
              if: matrix.system.name == 'raspberry'
              run: |
                  wget https://github.com/raspberrypi/firmware/archive/master.tar.gz -O rpi-firmware.tar.gz
                  tar xvf rpi-firmware.tar.gz
                  cp -r firmware-master/hardfp/opt/vc/include/* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/include
                  cp firmware-master/hardfp/opt/vc/lib/lib* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib
                  cp firmware-master/hardfp/opt/vc/lib/pkgconfig/* ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib/pkgconfig
                  cp -r firmware-master/hardfp/opt/vc/lib/plugins ${{ github.workspace }}/build/${{ matrix.system.arch }}/${{ matrix.system.arch }}/sysroot/usr/lib
            - name: Zip up toolchain
              working-directory: ${{ github.workspace }}/build/${{ matrix.system.arch }}
              run: |
                  tar Jcf ${{ github.workspace }}/${{ matrix.system.name }}-${{ matrix.system.arch }}.tar.xz *
            - name: Create toolchain artifact
              uses: actions/upload-artifact@v2
              with:
                  name: ${{ matrix.system.name }}-${{ matrix.system.arch }}
                  path: ${{ github.workspace }}/build/${{ matrix.system.arch }}
            - name: Upload to release
              if: startsWith(github.ref, 'refs/tags/')
              working-directory: ${{ github.workspace }}/source
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: >
                  gh release upload ${GITHUB_REF:10}
                  ${{ github.workspace }}/${{ matrix.system.name }}-${{ matrix.system.arch }}.tar.xz
                  -R ${{ github.repository }}
                  --clobber
            - name: Upload manifest
              if: startsWith(github.ref, 'refs/tags/')
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: |
                 grep '^CT_GCC_VERSION\|^CT_BINUTILS_VERSION\|^CT_GLIBC_VERSION\|^CT_LINUX_VERSION\|^CT_STRACE_VERSION\|^CT_GDB_VERSION' ${{github.workspace}}/source/toolchains/${{matrix.system.name}}-ct/compiler/.config | grep -v '^#' > ${{matrix.system.name}}-${{matrix.system.arch}}.manifest
                 gh release upload ${GITHUB_REF:10} ${{matrix.system.name}}-${{matrix.system.arch}}.manifest -R ${{github.repository}} --clobber
    BuildSysroot:
        runs-on: ubuntu-latest
        needs: BuildCompilers
        strategy:
            matrix:
                system:
                    - name: beaglebone
                      arch: arm-unknown-linux-gnueabihf
                      sysroot: wayland
                    - name: desktop
                      arch: x86_64-unknown-linux-gnu
                      sysroot: multi
        steps:
            - uses: actions/checkout@v2
              with:
                  path: source
            - name: Download dependencies
              run: sudo apt install -y build-essential flex bison help2man libtool-bin
            - name: Download compiler
              uses: actions/download-artifact@v2
              with:
                  name: ${{ matrix.system.name }}-${{ matrix.system.arch }}
                  path: ${{ github.workspace }}/source/toolchains/${{matrix.system.name}}-ct/compiler/${{ matrix.system.arch }}
            - name: Make toolchain executable
              run: |
                  chmod -R a+wx ${{ github.workspace }}/source/toolchains/${{matrix.system.name}}-ct/compiler/${{matrix.system.arch}}
            - name: Download buildroot
              uses: actions/checkout@v2
              with:
                  path: source/toolchains/${{ matrix.system.name }}-ct/sysroot
                  repository: buildroot/buildroot
                  ref: '2020.11.3'
            - name: Copy config
              run: >
                  cp
                  ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot.${{ matrix.system.sysroot }}.config
                  ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot/.config
            - name: Build sysroot
              working-directory: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot
              run: |
                  ls -l ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/compiler/${{ matrix.system.arch }}
                  make sdk
            - name: Upload sysroot
              uses: actions/upload-artifact@v2
              with:
                  name: ${{ matrix.system.name }}-${{ matrix.system.arch }}-${{ matrix.system.sysroot }}
                  path: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot/output/host
            - name: Zip up sysroot
              working-directory: ${{ github.workspace }}/source/toolchains/${{ matrix.system.name }}-ct/sysroot/output/host
              run: |
                  tar Jcf ${{ github.workspace }}/${{ matrix.system.name }}-${{ matrix.system.arch }}_${{ matrix.system.sysroot }}.tar.xz *
            - name: Upload to release
              if: startsWith(github.ref, 'refs/tags/')
              working-directory: ${{ github.workspace }}/source
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              run: >
{'fraction_non_alphanumeric': 0.13634527724886042, 'fraction_numerical': 0.004039005250706826, 'mean_word_length': 1.5302189781021898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1193210', 'n_tokens_mistral': 5106, 'n_tokens_neox': 4643, 'n_words': 913}