diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml new file mode 100644 index 0000000..e965807 --- /dev/null +++ b/.github/workflows/clang.yml @@ -0,0 +1,75 @@ +name: Clang SNAPSHOT +on: + pull_request: + paths: + - '.github/actions/**' + - '.github/workflows/clang.yml' + schedule: + - cron: '22 02 * * *' + workflow_dispatch: + inputs: + skip_functional_tests: + description: 'Skip functional tests' + required: true + default: false + type: boolean + +concurrency: + group: ${{ github.workflow }}${{ github.event_name != 'pull_request' && github.run_id || github.ref }} + cancel-in-progress: true + +jobs: + clang: + name: 'Clang-SNAPSHOT, ${{ matrix.configuration.stdlib }}: system libs, no BDB, no GUI' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + configuration: + - stdlib: libstdc++ + - stdlib: libc++ + dependencies: libc++-${LLVM_VERSION}-dev libc++abi-${LLVM_VERSION}-dev + + steps: + - name: Checkout Bitcoin Core repo + uses: actions/checkout@v4 + with: + repository: bitcoin/bitcoin + + - name: Install dependencies + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + . /etc/os-release + REPO_NAME="deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" + sudo add-apt-repository -y "${REPO_NAME}" + sudo apt-get update + LLVM_VERSION=$(apt-cache search --names-only '^clang-[0-9]+$' | sort -V | tail -1 | cut -f1 -d" " | cut -f2 -d"-" ) + echo "LLVM_VERSION=${LLVM_VERSION}" >> "$GITHUB_ENV" + sudo apt-get install clang-${LLVM_VERSION} ${{ matrix.configuration.dependencies }} libboost-dev libevent-dev libsqlite3-dev libzmq3-dev systemtap-sdt-dev + + - name: Clang version + run: clang-${LLVM_VERSION} -v + + - name: Generate buildsystem + run: > + cmake -B build \ + -DCMAKE_C_COMPILER="clang-${LLVM_VERSION}" \ + -DCMAKE_CXX_COMPILER="clang++-${LLVM_VERSION};-stdlib=${{ matrix.configuration.stdlib }}" \ + -DBUILD_BENCH=ON \ + -DBUILD_FUZZ_BINARY=ON \ + -DWITH_ZMQ=ON \ + -DWITH_USDT=ON \ + -DWERROR=ON + + - name: Build + run: cmake --build build -j $(nproc) + + - name: Check 'bitcoind' executable + run: | + ls -l ./build/src/bitcoind + file ./build/src/bitcoind + ldd ./build/src/bitcoind + ./build/src/bitcoind -version + + - name: Run test suite + run: ctest --test-dir build -j $(nproc)