Move freebsd CI tests to github #410
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'CI' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| tests: | |
| runs-on: ${{ matrix.runs_on }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - displayTargetName: linux | |
| os: unix | |
| runs_on: ubuntu-22.04 | |
| shell: bash | |
| run_qemu: true | |
| - displayTargetName: kunit | |
| os: unix | |
| runs_on: ubuntu-22.04 | |
| shell: bash | |
| build_options: "kunit=yes" | |
| - displayTargetName: mmu_kasan | |
| os: unix | |
| runs_on: ubuntu-22.04 | |
| shell: bash | |
| build_options: "MMU=1 MMU_KUNIT=1 kasan=yes" | |
| - displayTargetName: windows-2022 | |
| os: windows | |
| runs_on: windows-2022 | |
| pip_option: --break-system-packages | |
| shell: msys2 {0} | |
| - displayTargetName: freebsd | |
| os: unix | |
| runs_on: ubuntu-22.04 | |
| shell: bash | |
| build_options: "LLVM=1 CROSS_COMPILE=x86_64-unknown-freebsd SYSROOT=~/freebsd-sysroot" | |
| make_sysroot: "./tools/lkl/scripts/freebsd-make-sysroot.sh" | |
| run_qemu: true | |
| - displayTargetName: fuzzers | |
| os: unix | |
| runs_on: ubuntu-22.04 | |
| shell: bash | |
| build_options: "LKL_FUZZING=1 MMU=1 fuzzers" | |
| timeout-minutes: 100 | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| USE_CCACHE: 1 | |
| defaults: | |
| run: | |
| shell: ${{ matrix.shell }} | |
| steps: | |
| - name: Set env | |
| shell: bash | |
| run: | | |
| echo "/usr/lib/ccache/bin:/usr/lib/ccache:/mingw64/bin:${{ github.workspace }}/bin" >> $GITHUB_PATH | |
| echo "export PATH=/usr/lib/ccache/bin:/usr/lib/ccache:/mingw64/bin:${{ github.workspace }}/bin:$PATH" >> $HOME/.bashrc | |
| - uses: msys2/setup-msys2@v2.26.0 | |
| if: runner.os == 'Windows' | |
| with: | |
| msystem: MSYS | |
| path-type: minimal | |
| update: true | |
| install: >- | |
| base-devel | |
| gcc | |
| git | |
| bc | |
| python-pip | |
| dosfstools | |
| mingw-w64-x86_64-ccache | |
| - name: Checkout | |
| if: runner.os == 'Linux' | |
| uses: actions/checkout@v4 | |
| - name: Install pip dependencies | |
| run: pip install ${{ matrix.pip_option }} yamlish junit-xml | |
| - name: Install openvpn | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| file: "OpenVPN-2.6.14-I001-amd64.msi" | |
| log: "install.log" | |
| run: | | |
| curl -L -O "https://swupdate.openvpn.org/community/releases/${{ env.file }}" | |
| $procMain = Start-Process "msiexec" "/i ${{ env.file }} /qn /l*! ${{ env.log }}" -NoNewWindow -PassThru | |
| $procLog = Start-Process "powershell" "Get-Content -Path ${{ env.log }} -Wait" -NoNewWindow -PassThru | |
| $procMain.WaitForExit() | |
| $procLog.Kill() | |
| - name: Partial Clone | |
| if: runner.os == 'Windows' | |
| shell: msys2 {0} | |
| run: | | |
| REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | |
| BRANCH="${GITHUB_REF/#refs\/heads\//}" | |
| git init . | |
| git remote add origin $REPO | |
| git config core.sparseCheckout true | |
| echo -e '/*\n!*aux.*' >> .git/info/sparse-checkout | |
| git -c protocol.version=2 fetch --no-tags --prune --progress --depth=10 origin +${GITHUB_SHA}:refs/remotes/origin/${BRANCH} | |
| git checkout --progress --force -B $BRANCH refs/remotes/origin/$BRANCH | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: ${{ matrix.displayTargetName }}-ccache-build-${{ github.sha }} | |
| restore-keys: ${{ matrix.displayTargetName }}-ccache-build- | |
| - name: Install ccache on ubuntu-latest | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt update -y | |
| sudo apt install -y ccache libjsmn-dev libfuse3-dev clang lld llvm qemu-system-x86 \ | |
| qemu-utils sshpass cloud-image-utils binutils cmake ninja-build liblzma-dev libz-dev \ | |
| pkg-config autoconf libtool | |
| - name: Install patched binutils for Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| cp -f tools/lkl/bin/*.exe /usr/bin/ | |
| - name: Fix broken msys2 ccache | |
| if: runner.os == 'Windows' | |
| run: | | |
| mkdir -p /usr/lib/ccache/bin | |
| cd /usr/lib/ccache/bin | |
| echo -e '#!/bin/bash\n\nccache /usr/bin/cc "$@"' > cc | |
| echo -e '#!/bin/bash\n\nccache /usr/bin/gcc "$@"' > gcc | |
| echo -e '#!/bin/bash\n\nccache /usr/bin/cpp "$@"' > cpp | |
| export PATH=/usr/lib/ccache/bin:/usr/lib/ccache:/mingw64/bin:$PATH | |
| which gcc | |
| ccache -z | |
| - name: install zpoline | |
| if: matrix.displayTargetName == 'zpoline' | |
| run: | | |
| sudo apt install -y binutils-dev lib32gcc-s1 | |
| git clone https://github.com/yasukata/zpoline | |
| cd zpoline | |
| git checkout 022a3b8c7a5c23bfd99162b478bf3eb5f70c07a2 | |
| make | |
| cd .. | |
| # This is the whole point of zpoline | |
| echo "==== setting mmap_min_addr ====" | |
| sudo sh -c "echo 0 > /proc/sys/vm/mmap_min_addr" | |
| echo "setting env variable (debug)" | |
| echo "ZPOLINE_DEBUG=0" >> "$GITHUB_ENV" | |
| - name: Start QEMU | |
| if: matrix.run_qemu | |
| run: | | |
| ./tools/lkl/scripts/qemu-${{ matrix.displayTargetName }}-make-images.sh | |
| sudo chmod a+rw /dev/kvm | |
| . tools/lkl/scripts/qemu-${{ matrix.displayTargetName }}-start-and-set-env.sh | |
| echo MYHOST="$MYHOST" >> $GITHUB_ENV | |
| echo MYSSH="$MYSSH" >> $GITHUB_ENV | |
| echo MYSCP="$MYSCP" >> $GITHUB_ENV | |
| echo LKL_QEMU_TEST=1 >> $GITHUB_ENV | |
| - name: Make sysroot | |
| run: | | |
| ${{ matrix.make_sysroot }} | |
| - name: Build libprotobuf-mutator | |
| if: matrix.displayTargetName == 'fuzzers' | |
| run: PROTOBUF_MUTATOR_DIR=/tmp/libprotobuf-mutator tools/lkl/scripts/libprotobuf-mutator-build.sh | |
| - name: Build | |
| run: | | |
| make -j4 -C tools/lkl ${{ matrix.build_options }} | |
| - name: Tests | |
| if: matrix.displayTargetName != 'fuzzers' | |
| run: mkdir junit && make -C tools/lkl run-tests tests="--junit-dir ../../junit" | |
| - name: Save test results | |
| uses: actions/upload-artifact@v5 | |
| if: success() || failure() | |
| with: | |
| name: test-results-${{ matrix.displayTargetName }} | |
| path: junit/*.xml | |
| event_file: | |
| name: "Event File" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Upload | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: Event File | |
| path: ${{ github.event_path }} | |
| checkpatch: | |
| runs-on: ubuntu-24.04 | |
| name: checkpatch | |
| steps: | |
| - name: Checkout | |
| with: | |
| fetch-depth: 0 | |
| uses: actions/checkout@v4 | |
| - name: Install pip dependencies | |
| run: sudo pip install ply GitPython | |
| - name: Check coding style | |
| run: tools/lkl/scripts/checkpatch.sh |