From 4f6f7183dba191e503ebe6e76620217da47b5884 Mon Sep 17 00:00:00 2001 From: hev Date: Sun, 12 May 2024 12:58:03 +0800 Subject: [PATCH] CI: Add build checker. --- .github/workflows/build.yaml | 80 ++++++++++++++++++++++++++++++++++++ .github/workflows/llvm.yaml | 30 -------------- README.md | 2 + 3 files changed, 82 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/llvm.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..249c8b026 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,80 @@ +name: "Build" + +on: + push: + pull_request: + +jobs: + linux: + name: Linux + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - name: arm64 + tool: aarch64-unknown-linux-musl + - name: arm32 + tool: arm-unknown-linux-musleabi + - name: arm32hf + tool: arm-unknown-linux-musleabihf + - name: loong64 + tool: loongarch64-unknown-linux-musl + - name: mips64el + tool: mips64el-unknown-linux-musl + - name: mips64 + tool: mips64-unknown-linux-musl + - name: mips32el + tool: mipsel-unknown-linux-musl + - name: mips32 + tool: mips-unknown-linux-musl + - name: riscv32 + tool: riscv32-unknown-linux-musl + - name: riscv64 + tool: riscv64-unknown-linux-musl + - name: x86_32 + tool: x86_64-multilib-linux-musl + env: + CFLAGS: "-m32" + - name: x86_64 + tool: x86_64-multilib-linux-musl + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - name: Build ${{ matrix.name }} + run: | + sudo mkdir -p /opt/x-tools + wget https://github.com/musl-cross/musl-cross/releases/download/20240317/${{ matrix.tool }}.tgz + sudo tar xf ${{ matrix.tool }}.tgz -C /opt/x-tools + make CROSS_PREFIX=/opt/x-tools/${{ matrix.tool }}/bin/${{ matrix.tool }}- CFLAGS=${{ matrix.env.CFLAGS }} ENABLE_STATIC=1 -j`nproc` + macos: + name: macOS + runs-on: macos-14 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - name: Build + run: | + make + llvm: + name: LLVM + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + submodules: true + - name: Prepare + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo add-apt-repository -y 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main' + sudo apt install -y clang + - name: Build + run: | + make CC=clang ENABLE_STATIC=1 -j`nproc` diff --git a/.github/workflows/llvm.yaml b/.github/workflows/llvm.yaml deleted file mode 100644 index 7c601b017..000000000 --- a/.github/workflows/llvm.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: LLVM Build Test - -on: - # Trigger the workflow on push or pull requests. - push: - pull_request: - -jobs: - build: - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - - steps: - - name: Checkout source - uses: actions/checkout@v3 - with: - fetch-depth: 1 - submodules: true - - name: Install Compilers - run: | - sudo apt-get purge -qq --auto-remove llvm python3-lldb-14 llvm-14 -y; - wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh; - sudo bash /tmp/llvm.sh 18; - sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 400; - sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 400; - - name: Build Linux - run: | - make CC=clang ENABLE_STATIC=1 -j diff --git a/README.md b/README.md index bf3610f3b..e04a7356e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # HevSocks5Server +[![status](https://github.com/heiher/hev-socks5-server/actions/workflows/build.yaml/badge.svg?branch=master&event=push)](https://github.com/heiher/hev-socks5-server) + HevSocks5Server is a simple, lightweight socks5 server for Unix. ## Features