diff --git a/.github/workflows/aarch64-alpine-linux.yml b/.github/workflows/aarch64-alpine-linux.yml deleted file mode 100644 index 15fe155..0000000 --- a/.github/workflows/aarch64-alpine-linux.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: aarch64-alpine-linux - -on: [push, pull_request] - -jobs: - setup-aarch64-alpine-linux: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . - - build-aarch64-alpine-linux: - runs-on: ubuntu-24.04-arm - needs: setup-aarch64-alpine-linux - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - sh -c "mkdir -p build && cd build && \ - cmake -DTARGET=aarch64-pc-linux-gnu \ - -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-aarch64-alpine-linux - path: build/ - - test-aarch64-alpine-linux: - runs-on: ubuntu-24.04-arm - needs: build-aarch64-alpine-linux - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-aarch64-alpine-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - sh -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/aarch64-apple-darwin.yml b/.github/workflows/aarch64-apple-darwin.yml deleted file mode 100644 index c01a00a..0000000 --- a/.github/workflows/aarch64-apple-darwin.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: aarch64-apple-darwin - -on: [push, pull_request] - -jobs: - setup-aarch64-apple-darwin: - runs-on: macos-15 - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: brew install cmake - - build-aarch64-apple-darwin: - runs-on: macos-15 - needs: setup-aarch64-apple-darwin - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: brew install cmake - - name: Configure - run: | - mkdir -p build && cd build - cmake -G "Unix Makefiles" -DTARGET=aarch64-apple-darwin .. - - name: Build - run: cd build && make -j$(sysctl -n hw.ncpu) - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-aarch64-apple-darwin - path: build/ - - test-aarch64-apple-darwin: - runs-on: macos-15 - needs: build-aarch64-apple-darwin - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-aarch64-apple-darwin - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/aarch64-apple-ios.yml b/.github/workflows/aarch64-apple-ios.yml deleted file mode 100644 index 9b30c28..0000000 --- a/.github/workflows/aarch64-apple-ios.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: aarch64-apple-ios - -on: [push, pull_request] - -jobs: - setup-aarch64-apple-ios: - name: Setup iOS (ARM64) - runs-on: macos-15 - steps: - - uses: actions/checkout@v4 - - build-aarch64-apple-ios: - name: Build iOS Simulator (ARM64) - runs-on: macos-15 - needs: setup-aarch64-apple-ios - steps: - - uses: actions/checkout@v4 - - name: Configure CMake - run: | - cmake -G Xcode \ - -DCMAKE_SYSTEM_NAME=iOS \ - -DTARGET=aarch64-apple-ios \ - -DCMAKE_OSX_ARCHITECTURES=arm64 \ - -B build - - name: Build - run: cmake --build build --config Debug - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-aarch64-apple-ios - path: build/ diff --git a/.github/workflows/aarch64-pc-linux-gnu.yml b/.github/workflows/aarch64-pc-linux-gnu.yml deleted file mode 100644 index 309fc7e..0000000 --- a/.github/workflows/aarch64-pc-linux-gnu.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: aarch64-pc-linux-gnu - -on: [push, pull_request] - -jobs: - setup-aarch64-pc-linux-gnu: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential - - build-aarch64-pc-linux-gnu: - runs-on: ubuntu-24.04-arm - needs: setup-aarch64-pc-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential - - name: Configure - run: | - mkdir -p build && cd build - cmake -G "Unix Makefiles" -DTARGET=aarch64-pc-linux-gnu .. - - name: Build - run: cd build && make -j$(nproc) - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-aarch64-pc-linux-gnu - path: build/ - - test-aarch64-pc-linux-gnu: - runs-on: ubuntu-24.04-arm - needs: build-aarch64-pc-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-aarch64-pc-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/aarch64-pc-windows-gnu.yml b/.github/workflows/aarch64-pc-windows-gnu.yml deleted file mode 100644 index 0fdea24..0000000 --- a/.github/workflows/aarch64-pc-windows-gnu.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: aarch64-pc-windows-gnu - -on: [push, pull_request] - -jobs: - setup-aarch64-pc-windows-gnu: - runs-on: windows-11-arm - steps: - - uses: actions/checkout@v4 - - name: Setup MinGW - uses: msys2/setup-msys2@v2 - with: - msystem: CLANGARM64 - update: true - cache: true - install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake - - build-aarch64-pc-windows-gnu: - runs-on: windows-11-arm - needs: setup-aarch64-pc-windows-gnu - steps: - - uses: actions/checkout@v4 - - name: Setup MinGW - uses: msys2/setup-msys2@v2 - with: - msystem: CLANGARM64 - update: true - cache: true - install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake - - name: Configure - shell: msys2 {0} - run: | - mkdir build; cd build - cmake -G "Ninja" -DTARGET=aarch64-pc-windows-gnu -DCMAKE_C_COMPILER=clang -DCMAKE_ASM_COMPILER=clang .. - - name: Build - shell: msys2 {0} - run: cmake --build build --parallel 4 - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-aarch64-pc-windows-gnu - path: build/ - - test-aarch64-pc-windows-gnu: - runs-on: windows-11-arm - needs: build-aarch64-pc-windows-gnu - steps: - - uses: actions/checkout@v4 - - name: Setup MinGW - uses: msys2/setup-msys2@v2 - with: - msystem: CLANGARM64 - update: true - cache: true - install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-aarch64-pc-windows-gnu - path: build/ - - name: Run Tests - shell: msys2 {0} - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/aarch64-pc-windows-msvc.yml b/.github/workflows/aarch64-pc-windows-msvc.yml deleted file mode 100644 index d9f3f02..0000000 --- a/.github/workflows/aarch64-pc-windows-msvc.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: aarch64-pc-windows-msvc - -on: [push, pull_request] - -jobs: - setup-aarch64-pc-windows-msvc: - runs-on: windows-11-arm - steps: - - uses: actions/checkout@v4 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: arm64 - - build-aarch64-pc-windows-msvc: - runs-on: windows-11-arm - needs: setup-aarch64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: arm64 - - name: Configure - run: | - mkdir build; cd build - cmake -G "Ninja" -DTARGET=aarch64-pc-windows-msvc -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl .. - - name: Build - run: cmake --build build --config Release --parallel 4 - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-aarch64-pc-windows-msvc - path: build/ - - test-aarch64-pc-windows-msvc: - runs-on: windows-11-arm - needs: build-aarch64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-aarch64-pc-windows-msvc - path: build/ - - name: Run Tests - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/arm-unknown-linux-gnueabihf.yml b/.github/workflows/arm-unknown-linux-gnueabihf.yml deleted file mode 100644 index de3491e..0000000 --- a/.github/workflows/arm-unknown-linux-gnueabihf.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: arm-unknown-linux-gnueabihf - -on: [push, pull_request] - -jobs: - setup-arm-unknown-linux-gnueabihf: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . - - build-arm-unknown-linux-gnueabihf: - runs-on: ubuntu-24.04 - needs: setup-arm-unknown-linux-gnueabihf - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=arm-unknown-linux-gnueabihf \ - -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-arm-unknown-linux-gnueabihf - path: build/ - - test-arm-unknown-linux-gnueabihf: - runs-on: ubuntu-24.04 - needs: build-arm-unknown-linux-gnueabihf - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: arm - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-arm-unknown-linux-gnueabihf - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/armv7-musl-linux.yml b/.github/workflows/armv7-musl-linux.yml deleted file mode 100644 index a7da622..0000000 --- a/.github/workflows/armv7-musl-linux.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: armv7-musl-linux - -on: [push, pull_request] - -jobs: - setup-armv7-musl-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - build-armv7-musl-linux: - runs-on: ubuntu-latest - needs: setup-armv7-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - - name: Download and install musl-cross toolchain - run: ./scripts/download-musl-cross.sh arm-unknown-linux-musleabihf - - name: Configure and Build - run: | - mkdir -p build && cd build - cmake -DTARGET=arm-unknown-linux-musleabihf \ - -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/arm-unknown-linux-musleabihf/bin/arm-unknown-linux-musleabihf-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_SYSTEM_PROCESSOR=arm \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm-static \ - .. - cmake --build . - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-armv7-musl-linux - path: build/ - - test-armv7-musl-linux: - runs-on: ubuntu-latest - needs: build-armv7-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install QEMU - run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-armv7-musl-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: | - cd build - ctest --output-on-failure diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..547d2c3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,979 @@ +name: CI +'on': + push: null + pull_request: null +jobs: + x86_64-pc-windows-msvc: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + - name: Configure + run: 'mkdir build; cd build + + cmake -G "Ninja" -DTARGET=x86_64-pc-windows-msvc -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl + .. + + ' + - name: Build + run: cmake --build build --config Release --parallel 4 + - name: Run Tests + run: cd build && ctest --output-on-failure + s390x-ibm-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: 'sudo apt-get update + + sudo apt-get install -y cmake build-essential gcc-s390x-linux-gnu qemu-user + + ' + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user + - name: Configure and Build + run: "mkdir -p build && cd build\ncmake -DTARGET=s390x-ibm-linux-gnu \\\n\ + \ -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x\ + \ \\\n ..\nmake\n" + - name: Run Tests + run: 'cd build + + CTEST_OUTPUT_ON_FAILURE=1 ctest + + ' + s390x-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh s390x-ibm-linux-musl + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support + - name: Configure and Build + run: "mkdir -p build && cd build\ncmake -DTARGET=s390x-ibm-linux-musl \\\n\ + \ -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/s390x-ibm-linux-musl/bin/s390x-ibm-linux-musl-gcc\ + \ \\\n -DCMAKE_C_FLAGS='-static' \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n -DCMAKE_SYSTEM_PROCESSOR=s390x \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x-static\ + \ \\\n ..\ncmake --build .\n" + - name: Run Tests + run: 'cd build + + ctest --output-on-failure + + ' + x86_64-alpine-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n sh\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=x86_64-pc-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=gcc \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n .. && \\\n cmake --build .\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n sh\ + \ -c \"cd build && ctest --output-on-failure\"\n" + riscv64-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh riscv64-unknown-linux-musl + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support + - name: Configure and Build + run: "mkdir -p build && cd build\ncmake -DTARGET=riscv64-unknown-linux-musl\ + \ \\\n -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/riscv64-unknown-linux-musl/bin/riscv64-unknown-linux-musl-gcc\ + \ \\\n -DCMAKE_C_FLAGS='-static' \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n -DCMAKE_SYSTEM_PROCESSOR=riscv64 \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64-static\ + \ \\\n ..\ncmake --build .\n" + - name: Run Tests + run: 'cd build + + ctest --output-on-failure + + ' + aarch64-pc-windows-gnu: + runs-on: windows-11-arm + steps: + - uses: actions/checkout@v4 + - name: Setup MinGW + uses: msys2/setup-msys2@v2 + with: + msystem: CLANGARM64 + update: true + cache: true + install: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-cmake + - name: Configure + shell: msys2 {0} + run: 'mkdir build; cd build + + cmake -G "Ninja" -DTARGET=aarch64-pc-windows-gnu -DCMAKE_C_COMPILER=clang + -DCMAKE_ASM_COMPILER=clang .. + + ' + - name: Build + shell: msys2 {0} + run: cmake --build build --parallel 4 + - name: Run Tests + shell: msys2 {0} + run: cd build && ctest --output-on-failure + aarch64-pc-windows-msvc: + runs-on: windows-11-arm + steps: + - uses: actions/checkout@v4 + - name: Setup MSVC + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: arm64 + - name: Configure + run: 'mkdir build; cd build + + cmake -G "Ninja" -DTARGET=aarch64-pc-windows-msvc -DCMAKE_C_COMPILER=cl + -DCMAKE_CXX_COMPILER=cl .. + + ' + - name: Build + run: cmake --build build --config Release --parallel 4 + - name: Run Tests + run: cd build && ctest --output-on-failure + i386-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: 'sudo apt-get update + + sudo apt-get install -y cmake build-essential gcc-multilib qemu-user + + ' + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user + - name: Configure and Build + run: "mkdir -p build && cd build\ncmake -DTARGET=i386-unknown-linux-gnu \\\ + \n -DCMAKE_C_COMPILER=gcc \\\n -DCMAKE_C_FLAGS='-m32 -static'\ + \ \\\n ..\nmake\n" + - name: Run Tests + run: 'cd build + + CTEST_OUTPUT_ON_FAILURE=1 ctest + + ' + x86_64-pc-windows-gnu: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Setup MinGW + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + cache: true + install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake + - name: Configure + shell: msys2 {0} + run: 'mkdir build; cd build + + cmake -G "Ninja" -DTARGET=x86_64-pc-windows-gnu -DCMAKE_C_COMPILER=gcc -DCMAKE_ASM_COMPILER=gcc + .. + + ' + - name: Build + shell: msys2 {0} + run: cmake --build build --parallel 4 + - name: Run Tests + shell: msys2 {0} + run: cd build && ctest --output-on-failure + ppc64le-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh powerpc64le-unknown-linux-musl + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support + - name: Configure and Build + run: "mkdir -p build && cd build\ncmake -DTARGET=powerpc64le-unknown-linux-musl\ + \ \\\n -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/powerpc64le-unknown-linux-musl/bin/powerpc64le-unknown-linux-musl-gcc\ + \ \\\n -DCMAKE_C_FLAGS='-static' \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n -DCMAKE_SYSTEM_PROCESSOR=ppc64le \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le-static\ + \ \\\n ..\ncmake --build .\n" + - name: Run Tests + run: 'cd build + + ctest --output-on-failure + + ' + aarch64-pc-linux-gnu: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: 'sudo apt-get update + + sudo apt-get install -y cmake build-essential + + ' + - name: Configure + run: 'mkdir -p build && cd build + + cmake -G "Unix Makefiles" -DTARGET=aarch64-pc-linux-gnu .. + + ' + - name: Build + run: cd build && make -j$(nproc) + - name: Run Tests + run: cd build && ctest --output-on-failure + powerpc64le-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc64le + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=powerpc64le-unknown-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le\ + \ \\\n .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + aarch64-apple-ios: + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + - name: Configure CMake + run: "cmake -G Xcode \\\n -DCMAKE_SYSTEM_NAME=iOS \\\n -DTARGET=aarch64-apple-ios\ + \ \\\n -DCMAKE_OSX_ARCHITECTURES=arm64 \\\n -B build\n" + - name: Build + run: cmake --build build --config Debug + aarch64-apple-darwin: + runs-on: macos-15 + steps: + - uses: actions/checkout@v4 + - name: Configure + run: 'mkdir -p build && cd build + + cmake -G "Unix Makefiles" -DTARGET=aarch64-apple-darwin .. + + ' + - name: Build + run: cd build && make -j$(sysctl -n hw.ncpu) + - name: Run Tests + run: cd build && ctest --output-on-failure + x86_64-apple-darwin: + runs-on: macos-15-intel + steps: + - uses: actions/checkout@v4 + - name: Configure + run: 'mkdir -p build && cd build + + cmake -G "Unix Makefiles" -DTARGET=x86_64-apple-darwin .. + + ' + - name: Build + run: cd build && make -j$(sysctl -n hw.ncpu) + - name: Run Tests + run: cd build && ctest --output-on-failure + x86_64-unknown-linux-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create Test Runner Script + run: 'echo ''#!/bin/bash'' > run_android.sh + + echo ''EXE_NAME=$(basename "$1")'' >> run_android.sh + + echo ''adb push "$1" "/data/local/tmp/$EXE_NAME" > /dev/null'' >> run_android.sh + + echo ''shift'' >> run_android.sh + + echo ''adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME + $@"'' >> run_android.sh + + chmod +x run_android.sh + + ' + - name: Configure CMake + run: "cmake \\\n -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake\ + \ \\\n -DTARGET=x86_64-unknown-linux-android \\\n -DANDROID_ABI=x86_64\ + \ \\\n -DANDROID_PLATFORM=android-29 \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=$(pwd)/run_android.sh\ + \ \\\n -B build\n" + - name: Build + run: cmake --build build --config Debug + - name: Enable KVM + run: 'echo ''KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"'' + | sudo tee /etc/udev/rules.d/99-kvm4all.rules + + sudo udevadm control --reload-rules + + sudo udevadm trigger --name-match=kvm + + ' + - name: Run Tests on Emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 34 + arch: x86_64 + target: google_apis + emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect + -noaudio -no-boot-anim -memory 8192 -no-metrics + disable-animations: true + script: '# Wait for emulator to be fully ready + + adb wait-for-device + + adb shell ''while [[ -z $(getprop sys.boot_completed) ]]; do sleep 30; + done'' + + cd build + + ctest --output-on-failure + + ' + x86_64-pc-linux-gnu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: 'sudo apt-get update + + sudo apt-get install -y cmake build-essential + + ' + - name: Configure + run: 'mkdir -p build && cd build + + cmake -G "Unix Makefiles" -DTARGET=x86_64-pc-linux-gnu -DENABLE_COVERAGE=ON + .. + + ' + - name: Build + run: cd build && make -j$(nproc) + - name: Run Tests + run: cd build && ctest --output-on-failure + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + powerpc-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ppc + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=powerpc-unknown-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=powerpc-linux-gnu-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc\ + \ \\\n .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + riscv64-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: riscv64 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=riscv64-unknown-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64\ + \ \\\n .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + sparc64-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: sparc64 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=sparc64-unknown-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=sparc64-linux-gnu-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-sparc64\ + \ \\\n .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + aarch64-alpine-linux: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-aarch64 . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n sh\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=aarch64-pc-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=gcc \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n .. && \\\n cmake --build .\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n sh\ + \ -c \"cd build && ctest --output-on-failure\"\n" + i386-alpine-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: i386 + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n sh\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=i386-unknown-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=gcc \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n .. && \\\n cmake --build .\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n sh\ + \ -c \"cd build && ctest --output-on-failure\"\n" + armv7-musl-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install build tools + run: sudo apt-get update && sudo apt-get install -y cmake make + - name: Download and install musl-cross toolchain + run: ./scripts/download-musl-cross.sh arm-unknown-linux-musleabihf + - name: Install QEMU + run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support + - name: Configure and Build + run: "mkdir -p build && cd build\ncmake -DTARGET=arm-unknown-linux-musleabihf\ + \ \\\n -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/arm-unknown-linux-musleabihf/bin/arm-unknown-linux-musleabihf-gcc\ + \ \\\n -DCMAKE_C_FLAGS='-static' \\\n -DCMAKE_SYSTEM_NAME=Linux\ + \ \\\n -DCMAKE_SYSTEM_PROCESSOR=arm \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm-static\ + \ \\\n ..\ncmake --build .\n" + - name: Run Tests + run: 'cd build + + ctest --output-on-failure + + ' + mips64el-unknown-linux-gnuabi64: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: mips64el + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=mips64el-unknown-linux-gnuabi64\ + \ \\\n -DCMAKE_C_COMPILER=mips64el-linux-gnuabi64-gcc \\\n \ + \ -DCMAKE_C_FLAGS='-static' \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n\ + \ -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-mips64el \\\n \ + \ .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + arm-unknown-linux-gnueabihf: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.arm32 . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=arm-unknown-linux-gnueabihf\ + \ \\\n -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-arm\ + \ \\\n .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + mipsel-unknown-linux-gnu: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: mipsel + - name: Build Docker image + run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . + - name: Build + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"mkdir -p build && cd build && \\\n cmake -DTARGET=mipsel-unknown-linux-gnu\ + \ \\\n -DCMAKE_C_COMPILER=mipsel-linux-gnu-gcc \\\n -DCMAKE_C_FLAGS='-static'\ + \ \\\n -DCMAKE_SYSTEM_NAME=Linux \\\n -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-mipsel\ + \ \\\n .. && \\\n make\"\n" + - name: Run Tests + run: "docker run --rm -v ${{ github.workspace }}:/src yafl-builder \\\n bash\ + \ -c \"cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest\"\n" + generate-badges: + needs: + - x86_64-pc-windows-msvc + - s390x-ibm-linux-gnu + - s390x-musl-linux + - x86_64-alpine-linux + - riscv64-musl-linux + - aarch64-pc-windows-gnu + - aarch64-pc-windows-msvc + - i386-unknown-linux-gnu + - x86_64-pc-windows-gnu + - ppc64le-musl-linux + - aarch64-pc-linux-gnu + - powerpc64le-unknown-linux-gnu + - aarch64-apple-ios + - aarch64-apple-darwin + - x86_64-apple-darwin + - x86_64-unknown-linux-android + - x86_64-pc-linux-gnu + - powerpc-unknown-linux-gnu + - riscv64-unknown-linux-gnu + - sparc64-unknown-linux-gnu + - aarch64-alpine-linux + - i386-alpine-linux + - armv7-musl-linux + - mips64el-unknown-linux-gnuabi64 + - arm-unknown-linux-gnueabihf + - mipsel-unknown-linux-gnu + if: always() + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up badges branch + run: "git fetch origin badges || true\nif git checkout badges; then\n echo\ + \ \"Switched to existing badges branch\"\nelse\n git checkout --orphan\ + \ badges\n git rm -rf .\nfi\nmkdir -p status\n" + - name: Set up directory + run: mkdir -p status + - name: Generate badge for x86_64-pc-windows-msvc + run: "if [ \"${{ needs.x86_64-pc-windows-msvc.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/x86_64-pc-windows-msvc.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n x86_64-pc-windows-msvc\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for s390x-ibm-linux-gnu + run: "if [ \"${{ needs.s390x-ibm-linux-gnu.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/s390x-ibm-linux-gnu.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n s390x-ibm-linux-gnu\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for s390x-musl-linux + run: "if [ \"${{ needs.s390x-musl-linux.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/s390x-musl-linux.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n s390x-musl-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for x86_64-alpine-linux + run: "if [ \"${{ needs.x86_64-alpine-linux.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/x86_64-alpine-linux.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n x86_64-alpine-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for riscv64-musl-linux + run: "if [ \"${{ needs.riscv64-musl-linux.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/riscv64-musl-linux.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n riscv64-musl-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for aarch64-pc-windows-gnu + run: "if [ \"${{ needs.aarch64-pc-windows-gnu.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/aarch64-pc-windows-gnu.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n aarch64-pc-windows-gnu\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for aarch64-pc-windows-msvc + run: "if [ \"${{ needs.aarch64-pc-windows-msvc.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/aarch64-pc-windows-msvc.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n aarch64-pc-windows-msvc\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for i386-unknown-linux-gnu + run: "if [ \"${{ needs.i386-unknown-linux-gnu.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/i386-unknown-linux-gnu.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n i386-unknown-linux-gnu\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for x86_64-pc-windows-gnu + run: "if [ \"${{ needs.x86_64-pc-windows-gnu.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/x86_64-pc-windows-gnu.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n x86_64-pc-windows-gnu\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for ppc64le-musl-linux + run: "if [ \"${{ needs.ppc64le-musl-linux.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/ppc64le-musl-linux.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n ppc64le-musl-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for aarch64-pc-linux-gnu + run: "if [ \"${{ needs.aarch64-pc-linux-gnu.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/aarch64-pc-linux-gnu.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n aarch64-pc-linux-gnu\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for powerpc64le-unknown-linux-gnu + run: "if [ \"${{ needs.powerpc64le-unknown-linux-gnu.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/powerpc64le-unknown-linux-gnu.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n powerpc64le-unknown-linux-gnu\n\ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for aarch64-apple-ios + run: "if [ \"${{ needs.aarch64-apple-ios.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/aarch64-apple-ios.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n aarch64-apple-ios\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for aarch64-apple-darwin + run: "if [ \"${{ needs.aarch64-apple-darwin.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/aarch64-apple-darwin.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n aarch64-apple-darwin\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for x86_64-apple-darwin + run: "if [ \"${{ needs.x86_64-apple-darwin.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/x86_64-apple-darwin.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n x86_64-apple-darwin\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for x86_64-unknown-linux-android + run: "if [ \"${{ needs.x86_64-unknown-linux-android.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/x86_64-unknown-linux-android.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n x86_64-unknown-linux-android\n\ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for x86_64-pc-linux-gnu + run: "if [ \"${{ needs.x86_64-pc-linux-gnu.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/x86_64-pc-linux-gnu.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n x86_64-pc-linux-gnu\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for powerpc-unknown-linux-gnu + run: "if [ \"${{ needs.powerpc-unknown-linux-gnu.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/powerpc-unknown-linux-gnu.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n powerpc-unknown-linux-gnu\n \ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for riscv64-unknown-linux-gnu + run: "if [ \"${{ needs.riscv64-unknown-linux-gnu.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/riscv64-unknown-linux-gnu.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n riscv64-unknown-linux-gnu\n \ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for sparc64-unknown-linux-gnu + run: "if [ \"${{ needs.sparc64-unknown-linux-gnu.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/sparc64-unknown-linux-gnu.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n sparc64-unknown-linux-gnu\n \ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for aarch64-alpine-linux + run: "if [ \"${{ needs.aarch64-alpine-linux.result }}\" == \"success\" ];\ + \ then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\ + \n TEXT=\"failing\"\nfi\ncat > status/aarch64-alpine-linux.svg << 'SVGEOF'\n\ + \n\ + \ \n \n \n \n \n \n \n \n \n \n \n \n \n aarch64-alpine-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for i386-alpine-linux + run: "if [ \"${{ needs.i386-alpine-linux.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/i386-alpine-linux.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n i386-alpine-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for armv7-musl-linux + run: "if [ \"${{ needs.armv7-musl-linux.result }}\" == \"success\" ]; then\n\ + \ COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"red\"\n TEXT=\"\ + failing\"\nfi\ncat > status/armv7-musl-linux.svg << 'SVGEOF'\n\n \n \n \n\ + \ \n \n \n \n \n \n \n \n \n \n armv7-musl-linux\n ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for mips64el-unknown-linux-gnuabi64 + run: "if [ \"${{ needs.mips64el-unknown-linux-gnuabi64.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/mips64el-unknown-linux-gnuabi64.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n mips64el-unknown-linux-gnuabi64\n\ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for arm-unknown-linux-gnueabihf + run: "if [ \"${{ needs.arm-unknown-linux-gnueabihf.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/arm-unknown-linux-gnueabihf.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n arm-unknown-linux-gnueabihf\n\ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Generate badge for mipsel-unknown-linux-gnu + run: "if [ \"${{ needs.mipsel-unknown-linux-gnu.result }}\" == \"success\"\ + \ ]; then\n COLOR=\"brightgreen\"\n TEXT=\"passing\"\nelse\n COLOR=\"\ + red\"\n TEXT=\"failing\"\nfi\ncat > status/mipsel-unknown-linux-gnu.svg\ + \ << 'SVGEOF'\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n mipsel-unknown-linux-gnu\n \ + \ ${TEXT}\n \n\nSVGEOF\n" + - name: Commit and push badges + run: "git config user.name \"GitHub Actions\"\ngit config user.email \"actions@github.com\"\ + \ngit add status/*.svg\nif ! git diff --staged --quiet; then\n git commit\ + \ -m \"Update build status badges [skip ci]\"\n git push origin badges\n\ + else\n echo \"No badge changes to commit.\"\nfi\n" +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 6898f08..d20e6db 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,11 +1,11 @@ name: coverage - -on: +true: push: - branches: [prerelease] + branches: + - prerelease pull_request: - branches: [prerelease] - + branches: + - prerelease jobs: coverage-linux: strategy: @@ -17,44 +17,48 @@ jobs: - arch: aarch64 runner: ubuntu-24.04-arm runs-on: ${{ matrix.runner }} - steps: - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update + run: 'sudo apt-get update + sudo apt-get install -y lcov cmake build-essential + ' - name: Configure - run: | - cmake -S . -B build -DENABLE_COVERAGE=ON + run: 'cmake -S . -B build -DENABLE_COVERAGE=ON + ' - name: Build run: cmake --build build - - name: Test run: ctest --test-dir build --output-on-failure - - name: Generate coverage report - run: | - lcov --capture --directory build --output-file coverage.info - lcov --ignore-errors unused --remove coverage.info '/usr/*' --output-file coverage.info - genhtml coverage.info --output-directory docs/coverage --title "yafl Code Coverage" + run: 'lcov --capture --directory build --output-file coverage.info + + lcov --ignore-errors unused --remove coverage.info ''/usr/*'' --output-file + coverage.info + + genhtml coverage.info --output-directory docs/coverage --title "yafl Code + Coverage" + ' - name: Generate coverage badge - run: | - chmod +x scripts/make_coverage_badge.sh - scripts/make_coverage_badge.sh docs/coverage_linux_${{ matrix.arch }}.svg coverage.info + run: 'chmod +x scripts/make_coverage_badge.sh + scripts/make_coverage_badge.sh docs/coverage_linux_${{ matrix.arch }}.svg + coverage.info + + ' - name: Upload Coverage Artifacts uses: actions/upload-artifact@v4 with: name: coverage-linux-${{ matrix.arch }} - path: | - docs/coverage + path: 'docs/coverage + docs/coverage_linux_${{ matrix.arch }}.svg + ' coverage-windows: strategy: fail-fast: false @@ -63,89 +67,64 @@ jobs: - arch: x86_64 runner: windows-latest cmake_arch: x64 - # Note: ARM64 Windows coverage skipped - OpenCppCoverage doesn't support ARM64 PE binaries - # ARM64 coverage is validated via Linux and macOS ARM64 coverage jobs runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v4 - - name: Install OpenCppCoverage - run: | - choco install opencppcoverage - echo "C:\Program Files (x86)\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + run: 'choco install opencppcoverage - - name: Configure - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -A ${{ matrix.cmake_arch }} + echo "C:\Program Files (x86)\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH + -Encoding utf8 -Append + ' + - name: Configure + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -A ${{ matrix.cmake_arch + }} - name: Build run: cmake --build build --config Debug - - name: Generate Coverage Report - run: | - # Find OpenCppCoverage installation - $opencppcoverage = Get-ChildItem -Path "C:\Program Files*" -Recurse -Filter "OpenCppCoverage.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 - if (-not $opencppcoverage) { - Write-Error "OpenCppCoverage.exe not found" - exit 1 - } - Write-Host "Using OpenCppCoverage from: $($opencppcoverage.FullName)" - & $opencppcoverage.FullName --sources "${{ github.workspace }}" --cover_children --export_type=html:build/coverage_report --export_type=cobertura:build/cobertura.xml -- ctest --test-dir build -C Debug --output-on-failure + run: "# Find OpenCppCoverage installation\n$opencppcoverage = Get-ChildItem\ + \ -Path \"C:\\Program Files*\" -Recurse -Filter \"OpenCppCoverage.exe\"\ + \ -ErrorAction SilentlyContinue | Select-Object -First 1\nif (-not $opencppcoverage)\ + \ {\n Write-Error \"OpenCppCoverage.exe not found\"\n exit 1\n}\nWrite-Host\ + \ \"Using OpenCppCoverage from: $($opencppcoverage.FullName)\"\n& $opencppcoverage.FullName\ + \ --sources \"${{ github.workspace }}\" --cover_children --export_type=html:build/coverage_report\ + \ --export_type=cobertura:build/cobertura.xml -- ctest --test-dir build\ + \ -C Debug --output-on-failure\n" shell: pwsh - - name: Generate Coverage Badge shell: powershell - run: | - if (-Not (Test-Path build/cobertura.xml)) { Write-Error "Cobertura XML not found"; exit 1 } - [xml]$xml = Get-Content build/cobertura.xml - $rate = $xml.coverage.'line-rate' - $percentage = [math]::Round([double]$rate * 100) - - if ($percentage -ge 90) { $color = "brightgreen" } - elseif ($percentage -ge 75) { $color = "yellow" } - else { $color = "red" } - - $svg = @" - - - - - - - - - - - - - - - coverage - ${percentage}% - - - "@ - - New-Item -ItemType Directory -Force -Path docs - $badgePath = "docs/coverage_windows_${{ matrix.arch }}.svg" - Set-Content -Path $badgePath -Value $svg - if (Test-Path $badgePath) { - Write-Host "Badge created: $badgePath (${percentage}% coverage)" - Get-Content $badgePath | Select-Object -First 5 - } else { - Write-Error "Failed to create badge file" - exit 1 - } - + run: "if (-Not (Test-Path build/cobertura.xml)) { Write-Error \"Cobertura\ + \ XML not found\"; exit 1 }\n[xml]$xml = Get-Content build/cobertura.xml\n\ + $rate = $xml.coverage.'line-rate'\n$percentage = [math]::Round([double]$rate\ + \ * 100)\n\nif ($percentage -ge 90) { $color = \"brightgreen\" }\nelseif\ + \ ($percentage -ge 75) { $color = \"yellow\" }\nelse { $color = \"red\"\ + \ }\n\n$svg = @\"\n\n \n \ + \ \n \n \n \n \n \ + \ \n \n \n \n \n \ + \ \n \n coverage\n ${percentage}%\n\ + \ \n\n\"@\n\nNew-Item -ItemType Directory -Force -Path docs\n\ + $badgePath = \"docs/coverage_windows_${{ matrix.arch }}.svg\"\nSet-Content\ + \ -Path $badgePath -Value $svg\nif (Test-Path $badgePath) {\n Write-Host\ + \ \"Badge created: $badgePath (${percentage}% coverage)\"\n Get-Content\ + \ $badgePath | Select-Object -First 5\n} else {\n Write-Error \"Failed\ + \ to create badge file\"\n exit 1\n}\n" - name: Upload Coverage Report uses: actions/upload-artifact@v4 with: name: coverage-windows-${{ matrix.arch }} - path: | - build/coverage_report + path: 'build/coverage_report + docs/coverage_windows_${{ matrix.arch }}.svg + ' coverage-macos: strategy: fail-fast: false @@ -160,78 +139,82 @@ jobs: runs-on: ${{ matrix.runner }} steps: - uses: actions/checkout@v4 - - name: Install dependencies run: brew install lcov - - name: Configure - run: | - cmake -S . -B build \ - -DENABLE_COVERAGE=ON \ - -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} - + run: "cmake -S . -B build \\\n -DENABLE_COVERAGE=ON \\\n -DCMAKE_BUILD_TYPE=Debug\ + \ \\\n -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }}\n" - name: Build run: cmake --build build - - name: Test run: ctest --test-dir build --output-on-failure - - name: Create gcov wrapper - run: | - cat > /usr/local/bin/llvm-gcov << 'EOF' + run: 'cat > /usr/local/bin/llvm-gcov << ''EOF'' + #!/bin/bash + exec xcrun llvm-cov gcov "$@" + EOF + chmod +x /usr/local/bin/llvm-gcov + ' - name: Generate Coverage Report - run: | - lcov --gcov-tool llvm-gcov --capture --directory build --output-file coverage.info - lcov --gcov-tool llvm-gcov --ignore-errors unused --remove coverage.info '/usr/*' --output-file coverage.info - genhtml coverage.info --output-directory docs/coverage --title "yafl Code Coverage" + run: 'lcov --gcov-tool llvm-gcov --capture --directory build --output-file + coverage.info + + lcov --gcov-tool llvm-gcov --ignore-errors unused --remove coverage.info + ''/usr/*'' --output-file coverage.info + genhtml coverage.info --output-directory docs/coverage --title "yafl Code + Coverage" + + ' - name: Generate Coverage Badge - run: | - chmod +x scripts/make_coverage_badge.sh - scripts/make_coverage_badge.sh docs/coverage_macos_${{ matrix.arch }}.svg coverage.info + run: 'chmod +x scripts/make_coverage_badge.sh + + scripts/make_coverage_badge.sh docs/coverage_macos_${{ matrix.arch }}.svg + coverage.info + ' - name: Upload Coverage Report uses: actions/upload-artifact@v4 with: name: coverage-macos-${{ matrix.arch }} - path: | - docs/coverage + path: 'docs/coverage + docs/coverage_macos_${{ matrix.arch }}.svg + ' commit-badges: - needs: [coverage-linux, coverage-macos, coverage-windows] + needs: + - coverage-linux + - coverage-macos + - coverage-windows runs-on: ubuntu-latest if: always() && github.event_name == 'push' && github.ref == 'refs/heads/prerelease' steps: - uses: actions/checkout@v4 - - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts - - name: Move badges - run: | - mkdir -p docs + run: 'mkdir -p docs + find artifacts -name "coverage_*.svg" -exec cp {} docs/ \; + ' - name: Create GitHub Pages configuration - run: | - touch docs/.nojekyll + run: 'touch docs/.nojekyll + ' - name: Commit and push coverage badges - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - git add docs/coverage_*.svg docs/.nojekyll - if git diff --quiet --cached; then - echo "No coverage badge changes to commit" - else - git commit -m "Update code coverage badges [skip ci]" && git push origin prerelease - fi + run: "git config user.name \"GitHub Actions\"\ngit config user.email \"actions@github.com\"\ + \ngit add docs/coverage_*.svg docs/.nojekyll\nif git diff --quiet --cached;\ + \ then\n echo \"No coverage badge changes to commit\"\nelse\n git commit\ + \ -m \"Update code coverage badges [skip ci]\" && git push origin prerelease\n\ + fi\n" +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' diff --git a/.github/workflows/i386-alpine-linux.yml b/.github/workflows/i386-alpine-linux.yml deleted file mode 100644 index b53d816..0000000 --- a/.github/workflows/i386-alpine-linux.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: i386-alpine-linux - -on: [push, pull_request] - -jobs: - setup-i386-alpine-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . - - build-i386-alpine-linux: - runs-on: ubuntu-latest - needs: setup-i386-alpine-linux - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - sh -c "mkdir -p build && cd build && \ - cmake -DTARGET=i386-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-i386-alpine-linux - path: build/ - - test-i386-alpine-linux: - runs-on: ubuntu-latest - needs: build-i386-alpine-linux - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: i386 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-i386-alpine-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-i386 . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - sh -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/i386-unknown-linux-gnu.yml b/.github/workflows/i386-unknown-linux-gnu.yml deleted file mode 100644 index 02eb8c6..0000000 --- a/.github/workflows/i386-unknown-linux-gnu.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: i386-unknown-linux-gnu - -on: [push, pull_request] - -jobs: - setup-i386-unknown-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential gcc-multilib qemu-user - - build-i386-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-i386-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential gcc-multilib qemu-user - - name: Configure and Build - run: | - mkdir -p build && cd build - cmake -DTARGET=i386-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_C_FLAGS='-m32 -static' \ - .. - make - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-i386-unknown-linux-gnu - path: build/ - - test-i386-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-i386-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Install QEMU - run: sudo apt-get update && sudo apt-get install -y qemu-user - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-i386-unknown-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: | - cd build - CTEST_OUTPUT_ON_FAILURE=1 ctest diff --git a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml b/.github/workflows/mips64el-unknown-linux-gnuabi64.yml deleted file mode 100644 index e95e75f..0000000 --- a/.github/workflows/mips64el-unknown-linux-gnuabi64.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: mips64el-unknown-linux-gnuabi64 - -on: [push, pull_request] - -jobs: - setup-mips64el-unknown-linux-gnuabi64: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . - - build-mips64el-unknown-linux-gnuabi64: - runs-on: ubuntu-24.04 - needs: setup-mips64el-unknown-linux-gnuabi64 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=mips64el-unknown-linux-gnuabi64 \ - -DCMAKE_C_COMPILER=mips64el-linux-gnuabi64-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-mips64el \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-mips64el-unknown-linux-gnuabi64 - path: build/ - - test-mips64el-unknown-linux-gnuabi64: - runs-on: ubuntu-24.04 - needs: build-mips64el-unknown-linux-gnuabi64 - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: mips64el - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-mips64el-unknown-linux-gnuabi64 - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mips64el . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/mipsel-unknown-linux-gnu.yml b/.github/workflows/mipsel-unknown-linux-gnu.yml deleted file mode 100644 index d0ecfe2..0000000 --- a/.github/workflows/mipsel-unknown-linux-gnu.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: mipsel-unknown-linux-gnu - -on: [push, pull_request] - -jobs: - setup-mipsel-unknown-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . - - build-mipsel-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-mipsel-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=mipsel-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=mipsel-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-mipsel \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-mipsel-unknown-linux-gnu - path: build/ - - test-mipsel-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-mipsel-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: mipsel - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-mipsel-unknown-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.mipsel . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/powerpc-unknown-linux-gnu.yml b/.github/workflows/powerpc-unknown-linux-gnu.yml deleted file mode 100644 index d791e14..0000000 --- a/.github/workflows/powerpc-unknown-linux-gnu.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: powerpc-unknown-linux-gnu - -on: [push, pull_request] - -jobs: - setup-powerpc-unknown-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . - - build-powerpc-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-powerpc-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=powerpc-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=powerpc-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-powerpc-unknown-linux-gnu - path: build/ - - test-powerpc-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-powerpc-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ppc - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-powerpc-unknown-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.powerpc . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/powerpc64le-unknown-linux-gnu.yml b/.github/workflows/powerpc64le-unknown-linux-gnu.yml deleted file mode 100644 index b43d5d6..0000000 --- a/.github/workflows/powerpc64le-unknown-linux-gnu.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: powerpc64le-unknown-linux-gnu - -on: [push, pull_request] - -jobs: - setup-powerpc64le-unknown-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . - - build-powerpc64le-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-powerpc64le-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=powerpc64le-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=powerpc64le-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-powerpc64le-unknown-linux-gnu - path: build/ - - test-powerpc64le-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-powerpc64le-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: ppc64le - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-powerpc64le-unknown-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.powerpc64le . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/ppc64le-musl-linux.yml b/.github/workflows/ppc64le-musl-linux.yml deleted file mode 100644 index 34271c7..0000000 --- a/.github/workflows/ppc64le-musl-linux.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: ppc64le-musl-linux - -on: [push, pull_request] - -jobs: - setup-ppc64le-musl-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - build-ppc64le-musl-linux: - runs-on: ubuntu-latest - needs: setup-ppc64le-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - - name: Download and install musl-cross toolchain - run: ./scripts/download-musl-cross.sh powerpc64le-unknown-linux-musl - - name: Configure and Build - run: | - mkdir -p build && cd build - cmake -DTARGET=powerpc64le-unknown-linux-musl \ - -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/powerpc64le-unknown-linux-musl/bin/powerpc64le-unknown-linux-musl-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_SYSTEM_PROCESSOR=ppc64le \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-ppc64le-static \ - .. - cmake --build . - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-ppc64le-musl-linux - path: build/ - - test-ppc64le-musl-linux: - runs-on: ubuntu-latest - needs: build-ppc64le-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install QEMU - run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-ppc64le-musl-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: | - cd build - ctest --output-on-failure diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2e38fa..905d7bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,216 +1,78 @@ name: Release - -on: - workflow_run: - workflows: - - x86_64-pc-linux-gnu - - aarch64-pc-linux-gnu - - x86_64-apple-darwin - - aarch64-apple-darwin - - x86_64-pc-windows-msvc - - aarch64-pc-windows-msvc - - x86_64-pc-windows-gnu - - aarch64-pc-windows-gnu - - x86_64-unknown-linux-android - - aarch64-apple-ios - - arm-unknown-linux-gnueabihf - - riscv64-unknown-linux-gnu - - mipsel-unknown-linux-gnu - - mips64el-unknown-linux-gnuabi64 - - powerpc64le-unknown-linux-gnu - - s390x-ibm-linux-gnu - - sparc64-unknown-linux-gnu - - powerpc-unknown-linux-gnu - - i386-unknown-linux-gnu - - x86_64-alpine-linux - - i386-alpine-linux - - aarch64-alpine-linux - - armv7-musl-linux - - ppc64le-musl-linux - - s390x-musl-linux - - riscv64-musl-linux - types: - - completed - +true: + workflow_run: + workflows: + - CI + types: + - completed permissions: - contents: write - pull-requests: read - + contents: write + pull-requests: read jobs: - check-and-release: - runs-on: ubuntu-latest - # Only run if the triggering workflow succeeded AND it ran on the release branch - if: ${{ github.event.workflow_run.head_branch == 'release' && github.event.workflow_run.conclusion == 'success' }} - steps: - - name: Log trigger information - run: | - echo "Triggered by workflow: ${{ github.event.workflow_run.name }}" - echo "Workflow status: ${{ github.event.workflow_run.conclusion }}" - echo "Branch: ${{ github.event.workflow_run.head_branch }}" - echo "Commit SHA: ${{ github.event.workflow_run.head_sha }}" - - - name: Check all workflow statuses - id: check-all - uses: actions/github-script@v7 - with: - script: | - const target_workflows = [ - "x86_64-pc-linux-gnu", - "aarch64-pc-linux-gnu", - "x86_64-apple-darwin", - "aarch64-apple-darwin", - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - "x86_64-pc-windows-gnu", - "aarch64-pc-windows-gnu", - "x86_64-unknown-linux-android", - "aarch64-apple-ios", - "arm-unknown-linux-gnueabihf", - "riscv64-unknown-linux-gnu", - "mipsel-unknown-linux-gnu", - "mips64el-unknown-linux-gnuabi64", - "powerpc64le-unknown-linux-gnu", - "s390x-ibm-linux-gnu", - "sparc64-unknown-linux-gnu", - "powerpc-unknown-linux-gnu", - "i386-unknown-linux-gnu", - "x86_64-alpine-linux", - "i386-alpine-linux", - "aarch64-alpine-linux", - "armv7-musl-linux", - "ppc64le-musl-linux", - "s390x-musl-linux", - "riscv64-musl-linux" - ]; - - const commit_sha = context.payload.workflow_run.head_sha; - const { owner, repo } = context.repo; - - console.log(`Checking workflow statuses for commit: ${commit_sha}`); - - // Fetch all runs for this commit - const { data: { workflow_runs } } = await github.rest.actions.listWorkflowRunsForRepo({ - owner, - repo, - head_sha: commit_sha, - per_page: 100 - }); - - // Map workflow name to its latest run - const latest_runs = {}; - for (const run of workflow_runs) { - if (target_workflows.includes(run.name)) { - // If we haven't seen this workflow yet, or this run is newer - if (!latest_runs[run.name] || new Date(run.created_at) > new Date(latest_runs[run.name].created_at)) { - latest_runs[run.name] = run; - } - } - } - - const failed = []; - const pending = []; - const succeeded = []; - - for (const name of target_workflows) { - const run = latest_runs[name]; - if (!run) { - console.log(` ${name}: NO RUN FOUND`); - pending.push(name); - } else if (run.status !== 'completed') { - console.log(` ${name}: ${run.status}`); - pending.push(name); - } else if (run.conclusion !== 'success') { - console.log(` ${name}: completed with ${run.conclusion}`); - failed.push(name); - } else { - console.log(` ${name}: success`); - succeeded.push(name); - } - } - - console.log(`\nSummary: ${succeeded.length} succeeded, ${pending.length} pending, ${failed.length} failed`); - - if (pending.length > 0) { - console.log(`Waiting for ${pending.length} workflows to complete: ${pending.join(', ')}`); - core.setOutput("ready", "false"); - core.notice(`Release skipped: waiting for ${pending.length} workflows to complete`); - return; // Exit successfully but do nothing; wait for next trigger - } - - if (failed.length > 0) { - core.setFailed(`One or more workflows failed: ${failed.join(', ')}`); - core.setOutput("ready", "false"); - return; - } - - console.log("All target workflows passed successfully!"); - core.notice("All required workflows passed - creating release"); - core.setOutput("ready", "true"); - - - name: Perform Release - if: steps.check-all.outputs.ready == 'true' - uses: actions/checkout@v4 - with: - ref: ${{ github.event.workflow_run.head_sha }} - fetch-depth: 0 - - - name: Get Version - if: steps.check-all.outputs.ready == 'true' - run: | - if [ ! -f VERSION ]; then - echo "ERROR: VERSION file not found" - exit 1 - fi - VERSION=$(cat VERSION) - echo "Creating release for version: $VERSION" - echo "VERSION=$VERSION" >> $GITHUB_ENV - - - name: Get Release Details - if: steps.check-all.outputs.ready == 'true' - id: release_details - uses: actions/github-script@v7 - with: - script: | - const commit_sha = "${{ github.event.workflow_run.head_sha }}"; - const { owner, repo } = context.repo; - - // Try to find a PR associated with this commit - const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({ - owner, - repo, - commit_sha, - }); - - let title = ""; - let body = ""; - - if (prs.data.length > 0) { - const pr = prs.data[0]; - title = pr.title; - body = pr.body || ""; - } else { - // Fallback to commit message - const commit = await github.rest.repos.getCommit({ - owner, - repo, - ref: commit_sha, - }); - const message = commit.data.commit.message; - const lines = message.split('\n'); - title = lines[0]; - body = lines.slice(1).join('\n').trim(); - } - - core.setOutput("title", title); - core.setOutput("body", body); - - - name: Create Release - if: steps.check-all.outputs.ready == 'true' - uses: softprops/action-gh-release@v1 - with: - tag_name: v${{ env.VERSION }} - name: v${{ env.VERSION }} - ${{ steps.release_details.outputs.title }} - body: ${{ steps.release_details.outputs.body }} - target_commitish: ${{ github.event.workflow_run.head_sha }} - draft: false - prerelease: false + check-and-release: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.head_branch == 'release' && github.event.workflow_run.conclusion + == 'success' }} + steps: + - name: Log trigger information + run: 'echo "Triggered by workflow: ${{ github.event.workflow_run.name }}" + + echo "Workflow status: ${{ github.event.workflow_run.conclusion }}" + + echo "Branch: ${{ github.event.workflow_run.head_branch }}" + + echo "Commit SHA: ${{ github.event.workflow_run.head_sha }}" + + ' + - name: Checkout Code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_branch }} + - name: Read VERSION + id: get_version + run: 'VERSION=$(cat VERSION) + + echo "Creating release for version: $VERSION" + + echo "VERSION=$VERSION" >> $GITHUB_ENV + + ' + - name: Get Release Details + id: release_details + uses: actions/github-script@v7 + with: + script: "const commit_sha = \"${{ github.event.workflow_run.head_sha }}\"\ + ;\nconst { owner, repo } = context.repo;\n\n// Try to find a PR associated\ + \ with this commit\nconst prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({\n\ + \ owner,\n repo,\n commit_sha,\n});\n\nlet title = \"\";\nlet body\ + \ = \"\";\n\nif (prs.data.length > 0) {\n const pr = prs.data[0];\n \ + \ title = pr.title;\n body = pr.body || \"\";\n console.log(`Found PR\ + \ #${pr.number}: ${title}`);\n} else {\n // Fallback to commit message\ + \ if no PR found\n const commit = await github.rest.repos.getCommit({\n\ + \ owner,\n repo,\n ref: commit_sha,\n });\n title = commit.data.commit.message.split('\\\ + n')[0];\n body = commit.data.commit.message;\n console.log(`No PR found.\ + \ Using commit message: ${title}`);\n}\n\ncore.setOutput('title', title);\n\ + core.setOutput('body', body);\n" + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ env.VERSION }} + name: Release v${{ env.VERSION }} + body: '## ${{ steps.release_details.outputs.title }} + + + ${{ steps.release_details.outputs.body }} + + + ### Build Artifacts + + You can find the compilation artifact downloads for all required platforms + in the respective CI action execution artifacts. + + ' + target_commitish: ${{ github.event.workflow_run.head_sha }} + generate_release_notes: false + draft: false + prerelease: false +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' diff --git a/.github/workflows/riscv64-musl-linux.yml b/.github/workflows/riscv64-musl-linux.yml deleted file mode 100644 index e4a4691..0000000 --- a/.github/workflows/riscv64-musl-linux.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: riscv64-musl-linux - -on: [push, pull_request] - -jobs: - setup-riscv64-musl-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - build-riscv64-musl-linux: - runs-on: ubuntu-latest - needs: setup-riscv64-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - - name: Download and install musl-cross toolchain - run: ./scripts/download-musl-cross.sh riscv64-unknown-linux-musl - - name: Configure and Build - run: | - mkdir -p build && cd build - cmake -DTARGET=riscv64-unknown-linux-musl \ - -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/riscv64-unknown-linux-musl/bin/riscv64-unknown-linux-musl-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_SYSTEM_PROCESSOR=riscv64 \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64-static \ - .. - cmake --build . - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-riscv64-musl-linux - path: build/ - - test-riscv64-musl-linux: - runs-on: ubuntu-latest - needs: build-riscv64-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install QEMU - run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-riscv64-musl-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: | - cd build - ctest --output-on-failure diff --git a/.github/workflows/riscv64-unknown-linux-gnu.yml b/.github/workflows/riscv64-unknown-linux-gnu.yml deleted file mode 100644 index 88e857a..0000000 --- a/.github/workflows/riscv64-unknown-linux-gnu.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: riscv64-unknown-linux-gnu - -on: [push, pull_request] - -jobs: - setup-riscv64-unknown-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . - - build-riscv64-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-riscv64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=riscv64-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=riscv64-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-riscv64 \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-riscv64-unknown-linux-gnu - path: build/ - - test-riscv64-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-riscv64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: riscv64 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-riscv64-unknown-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.riscv64 . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/s390x-ibm-linux-gnu.yml b/.github/workflows/s390x-ibm-linux-gnu.yml deleted file mode 100644 index f622e33..0000000 --- a/.github/workflows/s390x-ibm-linux-gnu.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: s390x-ibm-linux-gnu - -on: [push, pull_request] - -jobs: - setup-s390x-ibm-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential gcc-s390x-linux-gnu qemu-user - - build-s390x-ibm-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-s390x-ibm-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential gcc-s390x-linux-gnu qemu-user - - name: Configure and Build - run: | - mkdir -p build && cd build - cmake -DTARGET=s390x-ibm-linux-gnu \ - -DCMAKE_C_COMPILER=s390x-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x \ - .. - make - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-s390x-ibm-linux-gnu - path: build/ - - test-s390x-ibm-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-s390x-ibm-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Install QEMU - run: sudo apt-get update && sudo apt-get install -y qemu-user - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-s390x-ibm-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: | - cd build - CTEST_OUTPUT_ON_FAILURE=1 ctest diff --git a/.github/workflows/s390x-musl-linux.yml b/.github/workflows/s390x-musl-linux.yml deleted file mode 100644 index fae667d..0000000 --- a/.github/workflows/s390x-musl-linux.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: s390x-musl-linux - -on: [push, pull_request] - -jobs: - setup-s390x-musl-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make - - build-s390x-musl-linux: - runs-on: ubuntu-latest - needs: setup-s390x-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install build tools - run: sudo apt-get update && sudo apt-get install -y cmake make wget qemu-user-static binfmt-support - - name: Download and install musl-cross toolchain - run: ./scripts/download-musl-cross.sh s390x-ibm-linux-musl - - name: Configure and Build - run: | - mkdir -p build && cd build - cmake -DTARGET=s390x-ibm-linux-musl \ - -DCMAKE_C_COMPILER=${{ github.workspace }}/cross-compilers/x-tools/s390x-ibm-linux-musl/bin/s390x-ibm-linux-musl-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_SYSTEM_PROCESSOR=s390x \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-s390x-static \ - .. - cmake --build . - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-s390x-musl-linux - path: build/ - - test-s390x-musl-linux: - runs-on: ubuntu-latest - needs: build-s390x-musl-linux - steps: - - uses: actions/checkout@v4 - - name: Install QEMU - run: sudo apt-get update && sudo apt-get install -y qemu-user-static binfmt-support - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-s390x-musl-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: | - cd build - ctest --output-on-failure diff --git a/.github/workflows/sparc64-unknown-linux-gnu.yml b/.github/workflows/sparc64-unknown-linux-gnu.yml deleted file mode 100644 index 0b3e7a7..0000000 --- a/.github/workflows/sparc64-unknown-linux-gnu.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: sparc64-unknown-linux-gnu - -on: [push, pull_request] - -jobs: - setup-sparc64-unknown-linux-gnu: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . - - build-sparc64-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: setup-sparc64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "mkdir -p build && cd build && \ - cmake -DTARGET=sparc64-unknown-linux-gnu \ - -DCMAKE_C_COMPILER=sparc64-linux-gnu-gcc \ - -DCMAKE_C_FLAGS='-static' \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/qemu-sparc64 \ - .. && \ - make" - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-sparc64-unknown-linux-gnu - path: build/ - - test-sparc64-unknown-linux-gnu: - runs-on: ubuntu-24.04 - needs: build-sparc64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - platforms: sparc64 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-sparc64-unknown-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.sparc64 . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - bash -c "cd build && CTEST_OUTPUT_ON_FAILURE=1 ctest" diff --git a/.github/workflows/update-version-readme.yml b/.github/workflows/update-version-readme.yml index c2ecf0f..a85eb37 100644 --- a/.github/workflows/update-version-readme.yml +++ b/.github/workflows/update-version-readme.yml @@ -1,12 +1,10 @@ name: Update README and Bump Patch Version - -on: +true: release: - types: [published] - + types: + - published permissions: contents: write - jobs: update-readme-and-version: runs-on: ubuntu-latest @@ -16,42 +14,57 @@ jobs: with: ref: release fetch-depth: 0 - - name: Extract version from tag id: version - run: | - VERSION=${GITHUB_REF#refs/tags/v} + run: 'VERSION=${GITHUB_REF#refs/tags/v} + echo "version=$VERSION" >> $GITHUB_OUTPUT + ' - name: Update README with current version - run: | - # Replace existing version line in README - sed -i "s/\*\*Latest Release:\*\*.*/Latest Release:** v${{ steps.version.outputs.version }}/" README.md + run: '# Replace existing version line in README + sed -i "s/\*\*Latest Release:\*\*.*/Latest Release:** v${{ steps.version.outputs.version + }}/" README.md + + ' - name: Commit README update to release - run: | - git config user.name "GitHub Actions" + run: 'git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add README.md - git commit -m "Update README with release v${{ steps.version.outputs.version }} [skip ci]" + + git commit -m "Update README with release v${{ steps.version.outputs.version + }} [skip ci]" + git push origin release + ' - name: Checkout prerelease branch uses: actions/checkout@v4 with: ref: prerelease fetch-depth: 0 - - name: Increment patch version on prerelease - run: | - chmod +x scripts/increment_version.sh + run: 'chmod +x scripts/increment_version.sh + scripts/increment_version.sh patch + ' - name: Commit version bump to prerelease - run: | - git config user.name "GitHub Actions" + run: 'git config user.name "GitHub Actions" + git config user.email "actions@github.com" + NEW_VERSION=$(cat VERSION) + git add VERSION + git commit -m "Bump patch version to $NEW_VERSION [skip ci]" + git push origin prerelease + + ' +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' diff --git a/.github/workflows/x86_64-alpine-linux.yml b/.github/workflows/x86_64-alpine-linux.yml deleted file mode 100644 index 6070179..0000000 --- a/.github/workflows/x86_64-alpine-linux.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: x86_64-alpine-linux - -on: [push, pull_request] - -jobs: - setup-x86_64-alpine-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . - - build-x86_64-alpine-linux: - runs-on: ubuntu-latest - needs: setup-x86_64-alpine-linux - steps: - - uses: actions/checkout@v4 - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . - - name: Build - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - sh -c "mkdir -p build && cd build && \ - cmake -DTARGET=x86_64-pc-linux-gnu \ - -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_SYSTEM_NAME=Linux \ - .. && \ - cmake --build ." - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-x86_64-alpine-linux - path: build/ - - test-x86_64-alpine-linux: - runs-on: ubuntu-latest - needs: build-x86_64-alpine-linux - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-x86_64-alpine-linux - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Build Docker image - run: docker build -t yafl-builder -f docker/Dockerfile.alpine-x86_64 . - - name: Run Tests - run: | - docker run --rm -v ${{ github.workspace }}:/src yafl-builder \ - sh -c "cd build && ctest --output-on-failure" diff --git a/.github/workflows/x86_64-apple-darwin.yml b/.github/workflows/x86_64-apple-darwin.yml deleted file mode 100644 index c84e369..0000000 --- a/.github/workflows/x86_64-apple-darwin.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: x86_64-apple-darwin - -on: [push, pull_request] - -jobs: - setup-x86_64-apple-darwin: - runs-on: macos-15-intel - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: brew install cmake - - build-x86_64-apple-darwin: - runs-on: macos-15-intel - needs: setup-x86_64-apple-darwin - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: brew install cmake - - name: Configure - run: | - mkdir -p build && cd build - cmake -G "Unix Makefiles" -DTARGET=x86_64-apple-darwin .. - - name: Build - run: cd build && make -j$(sysctl -n hw.ncpu) - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-x86_64-apple-darwin - path: build/ - - test-x86_64-apple-darwin: - runs-on: macos-15-intel - needs: build-x86_64-apple-darwin - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-x86_64-apple-darwin - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/x86_64-pc-linux-gnu.yml b/.github/workflows/x86_64-pc-linux-gnu.yml deleted file mode 100644 index c2be802..0000000 --- a/.github/workflows/x86_64-pc-linux-gnu.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: x86_64-pc-linux-gnu - -on: [push, pull_request] - -jobs: - setup-x86_64-pc-linux-gnu: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential - - build-x86_64-pc-linux-gnu: - runs-on: ubuntu-latest - needs: setup-x86_64-pc-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake build-essential - - name: Configure - run: | - mkdir -p build && cd build - cmake -G "Unix Makefiles" -DTARGET=x86_64-pc-linux-gnu -DENABLE_COVERAGE=ON .. - - name: Build - run: cd build && make -j$(nproc) - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-x86_64-pc-linux-gnu - path: build/ - - test-x86_64-pc-linux-gnu: - runs-on: ubuntu-latest - needs: build-x86_64-pc-linux-gnu - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-x86_64-pc-linux-gnu - path: build/ - - name: Restore execute permissions - run: chmod +x build/bin/* - - name: Run Tests - run: cd build && ctest --output-on-failure - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/x86_64-pc-windows-gnu.yml b/.github/workflows/x86_64-pc-windows-gnu.yml deleted file mode 100644 index 90d8c21..0000000 --- a/.github/workflows/x86_64-pc-windows-gnu.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: x86_64-pc-windows-gnu - -on: [push, pull_request] - -jobs: - setup-x86_64-pc-windows-gnu: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - name: Setup MinGW - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - update: true - cache: true - install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake - - build-x86_64-pc-windows-gnu: - runs-on: windows-latest - needs: setup-x86_64-pc-windows-gnu - steps: - - uses: actions/checkout@v4 - - name: Setup MinGW - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - update: true - cache: true - install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake - - name: Configure - shell: msys2 {0} - run: | - mkdir build; cd build - cmake -G "Ninja" -DTARGET=x86_64-pc-windows-gnu -DCMAKE_C_COMPILER=gcc -DCMAKE_ASM_COMPILER=gcc .. - - name: Build - shell: msys2 {0} - run: cmake --build build --parallel 4 - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-x86_64-pc-windows-gnu - path: build/ - - test-x86_64-pc-windows-gnu: - runs-on: windows-latest - needs: build-x86_64-pc-windows-gnu - steps: - - uses: actions/checkout@v4 - - name: Setup MinGW - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW64 - update: true - cache: true - install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-x86_64-pc-windows-gnu - path: build/ - - name: Run Tests - shell: msys2 {0} - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/x86_64-pc-windows-msvc.yml b/.github/workflows/x86_64-pc-windows-msvc.yml deleted file mode 100644 index 42c7f4e..0000000 --- a/.github/workflows/x86_64-pc-windows-msvc.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: x86_64-pc-windows-msvc - -on: [push, pull_request] - -jobs: - setup-x86_64-pc-windows-msvc: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - - build-x86_64-pc-windows-msvc: - runs-on: windows-latest - needs: setup-x86_64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - - name: Configure - run: | - mkdir build; cd build - cmake -G "Ninja" -DTARGET=x86_64-pc-windows-msvc -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl .. - - name: Build - run: cmake --build build --config Release --parallel 4 - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-x86_64-pc-windows-msvc - path: build/ - - test-x86_64-pc-windows-msvc: - runs-on: windows-latest - needs: build-x86_64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-x86_64-pc-windows-msvc - path: build/ - - name: Run Tests - run: cd build && ctest --output-on-failure diff --git a/.github/workflows/x86_64-unknown-linux-android.yml b/.github/workflows/x86_64-unknown-linux-android.yml deleted file mode 100644 index 1f7d8a4..0000000 --- a/.github/workflows/x86_64-unknown-linux-android.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: x86_64-unknown-linux-android - -on: [push, pull_request] - -jobs: - setup-x86_64-unknown-linux-android: - name: Setup Android (x86_64) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Create Test Runner Script - run: | - echo '#!/bin/bash' > run_android.sh - echo 'EXE_NAME=$(basename "$1")' >> run_android.sh - echo 'adb push "$1" "/data/local/tmp/$EXE_NAME" > /dev/null' >> run_android.sh - echo 'shift' >> run_android.sh - echo 'adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME $@"' >> run_android.sh - chmod +x run_android.sh - - build-x86_64-unknown-linux-android: - name: Build Android (x86_64) - runs-on: ubuntu-latest - needs: setup-x86_64-unknown-linux-android - steps: - - uses: actions/checkout@v4 - - name: Create Test Runner Script - run: | - echo '#!/bin/bash' > run_android.sh - echo 'EXE_NAME=$(basename "$1")' >> run_android.sh - echo 'adb push "$1" "/data/local/tmp/$EXE_NAME" > /dev/null' >> run_android.sh - echo 'shift' >> run_android.sh - echo 'adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME $@"' >> run_android.sh - chmod +x run_android.sh - - name: Configure CMake - run: | - cmake \ - -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \ - -DTARGET=x86_64-unknown-linux-android \ - -DANDROID_ABI=x86_64 \ - -DANDROID_PLATFORM=android-29 \ - -DCMAKE_CROSSCOMPILING_EMULATOR=$(pwd)/run_android.sh \ - -B build - - name: Build - run: cmake --build build --config Debug - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: build-x86_64-unknown-linux-android - path: build/ - - test-x86_64-unknown-linux-android: - name: Test Android Emulator (x86_64) - runs-on: ubuntu-latest - needs: build-x86_64-unknown-linux-android - steps: - - uses: actions/checkout@v4 - - name: Download build artifacts - uses: actions/download-artifact@v4 - with: - name: build-x86_64-unknown-linux-android - path: build/ - - name: Create Test Runner Script - run: | - echo '#!/bin/bash' > run_android.sh - echo 'EXE_NAME=$(basename "$1")' >> run_android.sh - echo 'adb push "$1" "/data/local/tmp/$EXE_NAME" > /dev/null' >> run_android.sh - echo 'shift' >> run_android.sh - echo 'adb shell "chmod +x /data/local/tmp/$EXE_NAME && /data/local/tmp/$EXE_NAME $@"' >> run_android.sh - chmod +x run_android.sh - - name: Enable KVM - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm - - name: Run Tests on Emulator - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 34 - arch: x86_64 - target: google_apis - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -memory 8192 -no-metrics - disable-animations: true - script: | - # Wait for emulator to be fully ready - adb wait-for-device - adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 30; done' - cd build - ctest --output-on-failure diff --git a/README.md b/README.md index dd9cdc2..db8e939 100644 --- a/README.md +++ b/README.md @@ -6,57 +6,57 @@ | Architecture | Compiler | OS | Libc | Status | Coverage | | ------------ | -------- | -- | ---- | ------ | -------- | -| x86_64 | GCC | Linux | glibc | [![x86_64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-linux-gnu.yml) | [![Coverage](docs/coverage_linux_x86_64.svg)](docs/coverage_linux_x86_64.svg) | -| aarch64 | GCC | Linux | glibc | [![aarch64-pc-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-linux-gnu.yml) | [![Coverage](docs/coverage_linux_aarch64.svg)](docs/coverage_linux_aarch64.svg) | -| ARM (32-bit) | GCC | Linux | glibc | [![arm-unknown-linux-gnueabihf](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/arm-unknown-linux-gnueabihf.yml) | - | -| RISC-V 64 | GCC | Linux | glibc | [![riscv64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-unknown-linux-gnu.yml) | - | -| MIPS (32-bit LE) | GCC | Linux | glibc | [![mipsel-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mipsel-unknown-linux-gnu.yml) | - | -| MIPS (64-bit LE) | GCC | Linux | glibc | [![mips64el-unknown-linux-gnuabi64](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/mips64el-unknown-linux-gnuabi64.yml) | - | -| PowerPC 64 LE | GCC | Linux | glibc | [![powerpc64le-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc64le-unknown-linux-gnu.yml) | - | -| PowerPC (32-bit) | GCC | Linux | glibc | [![powerpc-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/powerpc-unknown-linux-gnu.yml) | - | -| s390x | GCC | Linux | glibc | [![s390x-ibm-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-ibm-linux-gnu.yml) | - | -| SPARC 64 | GCC | Linux | glibc | [![sparc64-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/sparc64-unknown-linux-gnu.yml) | - | -| i386 | GCC | Linux | glibc | [![i386-unknown-linux-gnu](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-unknown-linux-gnu.yml) | - | +| x86_64 | GCC | Linux | glibc | [![x86_64-pc-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/x86_64-pc-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | [![Coverage](docs/coverage_linux_x86_64.svg)](docs/coverage_linux_x86_64.svg) | +| aarch64 | GCC | Linux | glibc | [![aarch64-pc-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/aarch64-pc-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | [![Coverage](docs/coverage_linux_aarch64.svg)](docs/coverage_linux_aarch64.svg) | +| ARM (32-bit) | GCC | Linux | glibc | [![arm-unknown-linux-gnueabihf](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/arm-unknown-linux-gnueabihf.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| RISC-V 64 | GCC | Linux | glibc | [![riscv64-unknown-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/riscv64-unknown-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| MIPS (32-bit LE) | GCC | Linux | glibc | [![mipsel-unknown-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/mipsel-unknown-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| MIPS (64-bit LE) | GCC | Linux | glibc | [![mips64el-unknown-linux-gnuabi64](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/mips64el-unknown-linux-gnuabi64.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| PowerPC 64 LE | GCC | Linux | glibc | [![powerpc64le-unknown-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/powerpc64le-unknown-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| PowerPC (32-bit) | GCC | Linux | glibc | [![powerpc-unknown-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/powerpc-unknown-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| s390x | GCC | Linux | glibc | [![s390x-ibm-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/s390x-ibm-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| SPARC 64 | GCC | Linux | glibc | [![sparc64-unknown-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/sparc64-unknown-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| i386 | GCC | Linux | glibc | [![i386-unknown-linux-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/i386-unknown-linux-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | ### Linux (Alpine Container, native musl) | Architecture | Compiler | OS | Libc | Status | Coverage | | ------------ | -------- | -- | ---- | ------ | -------- | -| x86_64 | GCC | Alpine Linux | musl | [![x86_64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/x86_64-alpine-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-alpine-linux.yml) | - | -| i386 | GCC | Alpine Linux | musl | [![i386-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/i386-alpine-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/i386-alpine-linux.yml) | - | -| aarch64 | GCC | Alpine Linux | musl | [![aarch64-alpine-linux](https://github.com/libplctag/yafl/actions/workflows/aarch64-alpine-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-alpine-linux.yml) | - | +| x86_64 | GCC | Alpine Linux | musl | [![x86_64-alpine-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/x86_64-alpine-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| i386 | GCC | Alpine Linux | musl | [![i386-alpine-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/i386-alpine-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| aarch64 | GCC | Alpine Linux | musl | [![aarch64-alpine-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/aarch64-alpine-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | ### Linux (musl.cc Cross-Compiler, QEMU Emulation) | Architecture | Compiler | OS | Libc | Status | Coverage | | ------------ | -------- | -- | ---- | ------ | -------- | -| ARM (32-bit) | GCC | Linux | musl | [![armv7-musl-linux](https://github.com/libplctag/yafl/actions/workflows/armv7-musl-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/armv7-musl-linux.yml) | - | -| PowerPC 64 LE | GCC | Linux | musl | [![ppc64le-musl-linux](https://github.com/libplctag/yafl/actions/workflows/ppc64le-musl-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/ppc64le-musl-linux.yml) | - | -| s390x | GCC | Linux | musl | [![s390x-musl-linux](https://github.com/libplctag/yafl/actions/workflows/s390x-musl-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/s390x-musl-linux.yml) | - | -| RISC-V 64 | GCC | Linux | musl | [![riscv64-musl-linux](https://github.com/libplctag/yafl/actions/workflows/riscv64-musl-linux.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/riscv64-musl-linux.yml) | - | +| ARM (32-bit) | GCC | Linux | musl | [![armv7-musl-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/armv7-musl-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| PowerPC 64 LE | GCC | Linux | musl | [![ppc64le-musl-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/ppc64le-musl-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| s390x | GCC | Linux | musl | [![s390x-musl-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/s390x-musl-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| RISC-V 64 | GCC | Linux | musl | [![riscv64-musl-linux](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/riscv64-musl-linux.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | ### macOS/iOS | Architecture | Compiler | OS | Libc | Status | Coverage | | ------------ | -------- | -- | ---- | ------ | -------- | -| x86_64 | Clang | macOS | libc | [![x86_64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-apple-darwin.yml) | [![Coverage](docs/coverage_macos_x86_64.svg)](docs/coverage_macos_x86_64.svg) | -| aarch64 | Clang | macOS | libc | [![aarch64-apple-darwin](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-darwin.yml) | [![Coverage](docs/coverage_macos_aarch64.svg)](docs/coverage_macos_aarch64.svg) | -| aarch64 | Clang | iOS | libc | [![aarch64-apple-ios](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-apple-ios.yml) | - | +| x86_64 | Clang | macOS | libc | [![x86_64-apple-darwin](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/x86_64-apple-darwin.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | [![Coverage](docs/coverage_macos_x86_64.svg)](docs/coverage_macos_x86_64.svg) | +| aarch64 | Clang | macOS | libc | [![aarch64-apple-darwin](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/aarch64-apple-darwin.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | [![Coverage](docs/coverage_macos_aarch64.svg)](docs/coverage_macos_aarch64.svg) | +| aarch64 | Clang | iOS | libc | [![aarch64-apple-ios](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/aarch64-apple-ios.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | ### Windows | Architecture | Compiler | OS | Libc | Status | Coverage | | ------------ | -------- | -- | ---- | ------ | -------- | -| x86_64 | MSVC | Windows | MSVCRT | [![x86_64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-msvc.yml) | [![Coverage](docs/coverage_windows_x86_64.svg)](docs/coverage_windows_x86_64.svg) | -| aarch64 | MSVC | Windows | MSVCRT | [![aarch64-pc-windows-msvc](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-msvc.yml) | [![Coverage](docs/coverage_windows_aarch64.svg)](docs/coverage_windows_aarch64.svg) | -| x86_64 | GCC (MinGW) | Windows | MSVCRT | [![x86_64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-pc-windows-gnu.yml) | - | -| aarch64 | GCC (MinGW) | Windows | MSVCRT | [![aarch64-pc-windows-gnu](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/aarch64-pc-windows-gnu.yml) | - | +| x86_64 | MSVC | Windows | MSVCRT | [![x86_64-pc-windows-msvc](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/x86_64-pc-windows-msvc.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | [![Coverage](docs/coverage_windows_x86_64.svg)](docs/coverage_windows_x86_64.svg) | +| aarch64 | MSVC | Windows | MSVCRT | [![aarch64-pc-windows-msvc](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/aarch64-pc-windows-msvc.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | [![Coverage](docs/coverage_windows_aarch64.svg)](docs/coverage_windows_aarch64.svg) | +| x86_64 | GCC (MinGW) | Windows | MSVCRT | [![x86_64-pc-windows-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/x86_64-pc-windows-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | +| aarch64 | GCC (MinGW) | Windows | MSVCRT | [![aarch64-pc-windows-gnu](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/aarch64-pc-windows-gnu.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | ### Android | Architecture | Compiler | OS | Libc | Status | Coverage | | ------------ | -------- | -- | ---- | ------ | -------- | -| x86_64 | Clang | Android | bionic | [![x86_64-unknown-linux-android](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml/badge.svg)](https://github.com/libplctag/yafl/actions/workflows/x86_64-unknown-linux-android.yml) | - | +| x86_64 | Clang | Android | bionic | [![x86_64-unknown-linux-android](https://raw.githubusercontent.com/kyle-github/libyafl/badges/status/x86_64-unknown-linux-android.svg)](https://github.com/kyle-github/libyafl/actions/workflows/ci.yml) | - | **Latest Release:** v0.1.0 @@ -201,11 +201,13 @@ yafl_fiber_t *fiber = yafl_fiber_create( ``` **Advantages:** + - Guard pages detect overflow/underflow - Memory efficient (address space reserved, minimal physical memory used) - Automatic bounds checking (SIGSEGV/access violation on overflow) **Implementation:** + - Linux/macOS: Uses `mmap()` + `mprotect()` with PROT_NONE guard pages - Windows: Uses `VirtualAlloc()` with PAGE_NOACCESS guard pages @@ -220,10 +222,12 @@ yafl_fiber_t *fiber = yafl_fiber_create( ``` **Advantages:** + - Simple allocation without guard page overhead - Useful for constrained environments **Limitations:** + - No overflow detection - Stack overflows cause undefined behavior @@ -244,12 +248,14 @@ printf("Stack used: %zu bytes\n", used); ``` **How it works:** + 1. Stack is filled with pattern `0xA5` at creation 2. As fiber executes, pattern is overwritten 3. On completion, scan detects how many bytes were used 4. Result: accurate measurement of maximum stack depth **Overhead:** + - Negligible runtime cost (only at creation/destruction) - Additional physical memory allocation (fills entire stack initially) @@ -257,7 +263,7 @@ printf("Stack used: %zu bytes\n", used); This library implements asymmetric fibers - a fiber can only suspend back to its resumer. -``` +```text Main Thread | resume(fiber) @@ -287,7 +293,7 @@ Not supported: Fiber A switching directly to Fiber B. Fibers always return to th ### Virtual Memory Stack -``` +```text ┌──────────────────────────┐ │ Guard Page (PROT_NONE) │ ├──────────────────────────┤ @@ -303,7 +309,7 @@ Not supported: Fiber A switching directly to Fiber B. Fibers always return to th ### Malloc Stack -``` +```text ┌──────────────────────────┐ │ User-allocated block │ No guard pages │ (N + 256 bytes) │ Simple heap allocation @@ -336,6 +342,7 @@ Tests included: - `test_yafl_many` - Scalability with 100 fibers Run all tests: + ```bash cd build && ctest --output-on-failure ``` @@ -343,6 +350,7 @@ cd build && ctest --output-on-failure ## Architecture Support Tested on: + - x86_64 (Linux, macOS, Windows) - ARM64 (Linux, macOS, iOS, Windows) - ARM (Linux) @@ -363,5 +371,5 @@ See `LICENSE` file for details. ## References -- **Boost.Context**: https://github.com/boostorg/context -- **POSIX**: https://pubs.opengroup.org/onlinepubs/9699919799/ +- **Boost.Context**: [https://github.com/boostorg/context](https://github.com/boostorg/context) +- **POSIX**: [https://pubs.opengroup.org/onlinepubs/9699919799/](https://pubs.opengroup.org/onlinepubs/9699919799/) diff --git a/VERSION b/VERSION index 8294c18..09a3acf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.2 \ No newline at end of file +0.6.0 \ No newline at end of file diff --git a/append_badges.py b/append_badges.py new file mode 100644 index 0000000..40f1e8b --- /dev/null +++ b/append_badges.py @@ -0,0 +1,67 @@ +import yaml + +with open('.github/workflows/ci.yml', 'r') as f: + data = yaml.safe_load(f) + +jobs = data.get('jobs', {}) +job_names = [k for k in jobs.keys() if k != 'generate-badges'] + +steps = [ + {"uses": "actions/checkout@v4", "with": {"ref": "badges"}}, + {"name": "Set up directory", "run": "mkdir -p status"} +] + +for j in job_names: + run_script = f"""if [ "${{{{ needs.{j}.result }}}}" == "success" ]; then + COLOR="brightgreen" + TEXT="passing" +else + COLOR="red" + TEXT="failing" +fi +cat > status/{j}.svg << 'SVGEOF' + + + + + + + + + + + + + + + {j} + ${{TEXT}} + + +SVGEOF +""" + steps.append({ + "name": f"Generate badge for {j}", + "run": run_script + }) + +steps.append({ + "name": "Commit and push badges", + "run": 'git config user.name "GitHub Actions"\ngit config user.email "actions@github.com"\ngit add status/*.svg\ngit diff --quiet && git diff --staged --quiet || (git commit -m "Update build status badges [skip ci]" && git push origin badges)' +}) + +badge_job = { + 'needs': list(job_names), + 'if': 'always()', + 'runs-on': 'ubuntu-latest', + 'steps': steps +} + +data['jobs']['generate-badges'] = badge_job + +class MyDumper(yaml.Dumper): + def increase_indent(self, flow=False, indentless=False): + return super(MyDumper, self).increase_indent(flow, False) + +with open('.github/workflows/ci.yml', 'w') as f: + yaml.dump(data, f, Dumper=MyDumper, sort_keys=False, default_flow_style=False) diff --git a/consolidate.py b/consolidate.py new file mode 100644 index 0000000..780b2d4 --- /dev/null +++ b/consolidate.py @@ -0,0 +1,80 @@ +import glob, yaml, os + +def get_workflows(): + workflows = glob.glob('.github/workflows/*.yml') + ignores = ['coverage.yml', 'release.yml', 'update-version-readme.yml', 'ci.yml'] + return [w for w in workflows if os.path.basename(w) not in ignores] + +def process_workflow(filepath): + with open(filepath, 'r') as f: + data = yaml.safe_load(f) + + target_name = data.get('name') + jobs = data.get('jobs', {}) + + combined_steps = [] + ordered_job_keys = [] + for prefix in ['setup', 'build', 'test']: + for k in list(jobs.keys()): + if k.startswith(prefix) and k not in ordered_job_keys: + ordered_job_keys.append(k) + for k in list(jobs.keys()): + if k not in ordered_job_keys: + ordered_job_keys.append(k) + + runs_on = None + + for k in ordered_job_keys: + job = jobs[k] + if not runs_on: + runs_on = job.get('runs-on') + + steps = job.get('steps', []) + for step in steps: + if 'uses' in step: + uses = step['uses'] + if 'actions/upload-artifact' in uses: continue + if 'actions/download-artifact' in uses: continue + if 'actions/checkout' in uses: + if any('actions/checkout' in s.get('uses', '') for s in combined_steps): + continue + combined_steps.append(step) + + combined_job = { + 'runs-on': runs_on, + 'steps': combined_steps + } + + for k in ordered_job_keys: + for extra_key in ['container', 'services', 'env']: + if extra_key in jobs[k] and extra_key not in combined_job: + combined_job[extra_key] = jobs[k][extra_key] + + return target_name, combined_job + +all_combined_jobs = {} +workflows_to_delete = get_workflows() + +for w in workflows_to_delete: + tname, cjob = process_workflow(w) + # the job_key should be a valid github actions job ID + job_key = os.path.basename(w).replace('.yml', '') + all_combined_jobs[job_key] = cjob + +ci_data = { + 'name': 'CI', + 'on': { + 'push': None, + 'pull_request': None + }, + 'jobs': all_combined_jobs +} + +class MyDumper(yaml.Dumper): + def increase_indent(self, flow=False, indentless=False): + return super(MyDumper, self).increase_indent(flow, False) + +with open('.github/workflows/ci.yml', 'w') as f: + yaml.dump(ci_data, f, Dumper=MyDumper, sort_keys=False, default_flow_style=False) + +print("Wrote ci.yml. Processed", len(workflows_to_delete), "workflows.") diff --git a/fix_ci.py b/fix_ci.py new file mode 100644 index 0000000..21daea6 --- /dev/null +++ b/fix_ci.py @@ -0,0 +1,34 @@ +import yaml + +with open('.github/workflows/ci.yml', 'r') as f: + data = yaml.safe_load(f) + +for job_name, job_info in data['jobs'].items(): + if job_name == 'generate-badges': continue + + seen_step_names = set() + new_steps = [] + + for step in job_info.get('steps', []): + if 'name' in step: + name = step['name'] + + # Skip redundant executable permission restore + if name == 'Restore execute permissions': continue + if step.get('run') and 'chmod +x build/bin' in str(step.get('run', '')): continue + + # Skip duplicated setup/install steps + if name in seen_step_names: continue + + seen_step_names.add(name) + + new_steps.append(step) + + job_info['steps'] = new_steps + +class MyDumper(yaml.Dumper): + def increase_indent(self, flow=False, indentless=False): + return super(MyDumper, self).increase_indent(flow, False) + +with open('.github/workflows/ci.yml', 'w') as f: + yaml.dump(data, f, Dumper=MyDumper, sort_keys=False, default_flow_style=False) diff --git a/parse_workflows.py b/parse_workflows.py new file mode 100644 index 0000000..999512c --- /dev/null +++ b/parse_workflows.py @@ -0,0 +1,7 @@ +import os, glob, yaml + +workflows = glob.glob('.github/workflows/*.yml') +workflows = [w for w in workflows if 'coverage' not in w and 'update-version' not in w and 'release' not in w] + +# We will collect the matrix entries +print("Parsing workflows...") diff --git a/tmp.yml b/tmp.yml new file mode 100644 index 0000000..e69de29 diff --git a/workflows.tar.gz b/workflows.tar.gz new file mode 100644 index 0000000..b9f922e Binary files /dev/null and b/workflows.tar.gz differ