diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 32ec657216d..00000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,95 +0,0 @@ -version: 2.1 -jobs: - build_and_test: - parameters: - compiler: - description: C++ compiler to build with - type: string - standard: - description: C++ standard to build with - type: string - mode: - description: mode to build and test with - type: string - with_dpdk: - default: "disable-dpdk" - description: build with DPDK enabled - type: enum - enum: ["disable-dpdk", "enable-dpdk"] - with_modules: - default: "disable-modules" - description: build with C++20 modules enabled - type: enum - enum: ["disable-modules", "enable-modules"] - machine: - image: ubuntu-2204:2023.04.2 - resource_class: large - steps: - - checkout - - run: git submodule sync - - run: git submodule update --init - - run: echo 'docker run --pids-limit -1 --security-opt seccomp=unconfined --network host --user "$(id -u):$(id -g)" --rm -v $PWD:$PWD -w $PWD docker.io/scylladb/seastar-toolchain:2024-02-01 "$@"' > run; chmod +x run - - when: - condition: - equal: [ "enable-dpdk", << parameters.with_dpdk >> ] - steps: - - run: ./run ./configure.py --compiler << parameters.compiler >> --c++-standard << parameters.standard >> --cook dpdk --enable-dpdk - - when: - condition: - equal: [ "enable-modules", << parameters.with_modules >> ] - steps: - - run: ./run ./configure.py --compiler << parameters.compiler >> --c++-standard << parameters.standard >> --enable-cxx-modules - - when: - condition: - and: - - equal: [ "disable-dpdk", << parameters.with_dpdk >> ] - - equal: [ "disable-modules", << parameters.with_modules >> ] - steps: - - run: ./run ./configure.py --compiler << parameters.compiler >> --c++-standard << parameters.standard >> - - when: - condition: - equal: [ dev, << parameters.mode >> ] - steps: - - run: ./run ninja -C build/<< parameters.mode >> checkheaders - - when: - condition: - equal: [ "enable-modules", << parameters.with_modules >> ] - steps: - - run: ./run ninja -C build/<< parameters.mode >> hello_cxx_module - - when: - condition: - equal: [ "disable-modules", << parameters.with_modules >> ] - steps: - - run: ./run ninja -C build/<< parameters.mode >> - - run: ./run ./test.py --mode=<< parameters.mode >> - -workflows: - version: 2 - build_and_test: - jobs: - - build_and_test: - matrix: - parameters: - compiler: ["clang++-18", "g++-13"] - standard: ["23", "20"] - mode: ["dev", "debug", "release"] - # only build this combination with dpdk enabled, so we don't double - # the size of the test matrix, and can at least test the build with - # dpdk enabled. - - build_and_test: - matrix: - parameters: - compiler: ["clang++-18"] - standard: ["23"] - mode: ["release"] - with_dpdk: [ "enable-dpdk" ] - # only build this combination with C++20 moduels enabled, so we don't double - # the size of the test matrix, and can at least test the build with - # C++20 modules enabled. - - build_and_test: - matrix: - parameters: - compiler: ["clang++-18"] - standard: ["23"] - mode: ["debug"] - with_modules: [ "enable-modules" ] diff --git a/.github/workflows/python-lint.yaml b/.github/workflows/python-lint.yaml new file mode 100644 index 00000000000..fbe1be5f6a9 --- /dev/null +++ b/.github/workflows/python-lint.yaml @@ -0,0 +1,16 @@ +name: Python format + +on: [push, pull_request] + +jobs: + python-format: + name: Enforce python format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: psf/black@24.8.0 + with: + version: "24.8.0" + src: ./scripts + # override options so that we can specify only specific files for now + options: "--check --diff --include=.*addr2line.*" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000000..d9a5f7d8c23 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,114 @@ +name: Test + +permissions: + contents: read + +on: + workflow_call: + inputs: + compiler: + description: 'the C++ compiler to use' + type: string + required: true + standard: + description: 'the C++ standard to use' + type: number + required: true + mode: + description: 'build mode (debug, dev or release)' + type: string + required: true + enables: + description: 'the --enable-* option passed to configure.py' + type: string + default: '' + required: false + enable-ccache: + description: 'build with ccache enabled' + type: boolean + default: true + required: false + options: + description: 'additional options passed to configure.py' + type: string + default: '' + required: false + crypto_provider: + description: 'cryptographic provider to use' + type: string + default: 'GnuTLS' + required: false + +jobs: + test: + timeout-minutes: 40 + runs-on: ubuntu-latest + container: fedora:40 + steps: + - name: Install Git + run: | + sudo dnf -y install git + + - uses: actions/checkout@v4 + with: + submodules: "${{ contains(inputs.enables, 'dpdk') }}" + + - name: Install build dependencies + run: | + sudo ./install-dependencies.sh + + - name: Install clang++ + if: ${{ inputs.compiler == 'clang++' }} + run: | + sudo dnf -y install clang + + - name: Install clang-scan-deps + if: ${{ contains(inputs.enables, 'cxx-modules') }} + run: | + sudo dnf -y install clang-tools-extra + + - name: Install ccache + if: ${{ inputs.enable-ccache }} + run: | + sudo dnf -y install ccache + + - name: Setup ccache + if: ${{ inputs.enable-ccache }} + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ inputs.compiler }}-${{ inputs.standard }}-${{ inputs.mode }}-${{ inputs.enables }} + + - name: Configure + run: | + if [ ${{ inputs.compiler }} = "clang++" ]; then + CC=clang + else + CC=gcc + fi + if ${{ inputs.enable-ccache }}; then + MAYBE_CCACHE_OPT="--ccache" + fi + ./configure.py \ + --c++-standard ${{ inputs.standard }} \ + --compiler ${{ inputs.compiler }} \ + --c-compiler $CC \ + --mode ${{ inputs.mode }} \ + $MAYBE_CCACHE_OPT \ + ${{ inputs.options }} \ + ${{ inputs.enables }} \ + --crypto-provider ${{ inputs.crypto_provider }} + + - name: Build + run: cmake --build build/${{inputs.mode}} + + - name: Check Header + if: ${{ inputs.mode == 'dev' && inputs.compiler == 'clang++' }} + run: cmake --build build/${{ inputs.mode }} --target checkheaders + + - name: Build with C++20 modules + if: ${{ contains(inputs.enables, 'cxx-modules') }} + run: cmake --build build/${{ inputs.mode }} --target hello_cxx_module + + - name: Test + if: ${{ ! contains(inputs.enables, 'cxx-modules') }} + run: ./test.py --mode=${{ inputs.mode }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000000..2b3f2852ac4 --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,64 @@ +name: Test + +permissions: + contents: read + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + regular_test: + name: "Test (${{ matrix.compiler }}, C++${{ matrix.standard}}, ${{ matrix.mode }}, ${{ matrix.crypto_provider }})" + uses: ./.github/workflows/test.yaml + strategy: + fail-fast: false + matrix: + compiler: [clang++, g++] + standard: [20, 23] + mode: [dev, debug, release] + crypto_provider: [GnuTLS, OpenSSL] + with: + compiler: ${{ matrix.compiler }} + standard: ${{ matrix.standard }} + mode: ${{ matrix.mode }} + enables: ${{ matrix.enables }} + options: ${{ matrix.options }} + crypto_provider: ${{ matrix.crypto_provider }} + build_with_dpdk: + name: "Test with DPDK enabled" + uses: ./.github/workflows/test.yaml + strategy: + fail-fast: false + with: + compiler: clang++ + standard: 23 + mode: release + enables: --enable-dpdk + options: --cook dpdk + build_with_cxx_modules_gnutls: + name: "Test with C++20 modules enabled (GnuTLS)" + uses: ./.github/workflows/test.yaml + strategy: + fail-fast: false + with: + compiler: clang++ + standard: 23 + mode: debug + enables: --enable-cxx-modules + enable-ccache: false + crypto_provider: GnuTLS + build_with_cxx_modules_openssl: + name: "Test with C++20 modules enabled (OpenSSL)" + uses: ./.github/workflows/test.yaml + strategy: + fail-fast: false + with: + compiler: clang++ + standard: 23 + mode: debug + enables: --enable-cxx-modules + enable-ccache: false + crypto_provider: OpenSSL