diff --git a/.circleci/config.yml b/.circleci/config.yml index c900afdb..63b84570 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -240,19 +240,6 @@ jobs: fi fi - check-clang-format: - docker: - - image: cimg/base:2022.12 - steps: - - run: - name: Install dependencies - command: sudo apt-get update && sudo apt-get install -y clang-format - - checkout - - run: - name: Check coding style using clang-format - command: | - find . -type f -and '(' -name '*.h' -or -name '*.c' -or -name '*.inc' ')' | xargs clang-format --dry-run --Werror - trigger-downstream-ci: docker: - image: cimg/base:2020.01 @@ -277,7 +264,6 @@ workflows: version: 2.1 build: jobs: - - check-clang-format - ubuntu: name: ubuntu-focal IMAGE: openquantumsafe/ci-ubuntu-focal-x86_64:latest diff --git a/.github/workflows/coding_style.yml b/.github/workflows/coding_style.yml new file mode 100644 index 00000000..a254c63a --- /dev/null +++ b/.github/workflows/coding_style.yml @@ -0,0 +1,20 @@ +name: Coding style tests +on: [workflow_call] + +jobs: + check_clang_format: + name: "Coding style" + runs-on: ubuntu-latest + strategy: + fail-fast: false + container: + image: openquantumsafe/ci-ubuntu-jammy:latest + steps: + - name: Install dependencies + run: apt-get update && apt-get install -y clang-format + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Check coding style using clang-format + run: find . -type f -and '(' -name '*.h' -or -name '*.c' -or -name '*.inc' ')' | xargs clang-format --dry-run --Werror \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c1898500..54c0d4fd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -7,9 +7,11 @@ on: branches: [ "main" ] jobs: - + coding_style_tests: + uses: ./.github/workflows/coding_style.yml linux_baseline: runs-on: ubuntu-latest + needs: [coding_style_tests] strategy: fail-fast: false matrix: @@ -30,6 +32,7 @@ jobs: linux_intel: runs-on: ubuntu-latest + needs: [coding_style_tests] strategy: fail-fast: false matrix: @@ -79,6 +82,7 @@ jobs: asan_linux_intel: name: "Security checks" runs-on: ubuntu-latest + needs: [coding_style_tests] strategy: fail-fast: false container: @@ -154,6 +158,7 @@ jobs: linux_aarch64: name: "aarch64 cross-compilation" runs-on: ubuntu-latest + needs: [coding_style_tests] strategy: fail-fast: false container: @@ -231,10 +236,12 @@ jobs: - name: Verify the .deb file target architecture. working-directory: build - run: dpkg -I oqs-provider-*.deb | grep -q "Architecture: arm64" + run: | + dpkg -I oqs-provider-*.deb | grep -q "Architecture: arm64" - name: Retain .deb installer uses: actions/upload-artifact@v3 with: name: oqsprovider-aarch64 path: build/*.deb + diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7aaeaf2d..63e903d5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -6,6 +6,8 @@ permissions: contents: read jobs: + coding_style_tests: + uses: ./.github/workflows/coding_style.yml macos: # Run a job for each of the specified os configs: strategy: @@ -18,6 +20,7 @@ jobs: params: - oqsconfig: -DOQS_ALGS_ENABLED=STD runs-on: ${{matrix.os}} + needs: [coding_style_tests] env: # Don't overwhelm github CI VMs: MAKE_PARAMS: -j 4 @@ -57,7 +60,7 @@ jobs: key: ${{ runner.os }}-openssl32 - name: build liboqs run: | - cmake -DOPENSSL_ROOT_DIR=../.localopenssl32 -DCMAKE_INSTALL_PREFIX=../.localliboqs ${{ matrix.params.oqsconfig }} -S . -B _build + cmake -DOPENSSL_ROOT_DIR=../.localopenssl32 -DCMAKE_INSTALL_PREFIX=../.localliboqs ${{ matrix.params.oqsconfig }} -S . -B _build cmake --build _build cmake --install _build working-directory: liboqs diff --git a/.github/workflows/standalone.yml b/.github/workflows/standalone.yml index 39b01457..3d11451b 100644 --- a/.github/workflows/standalone.yml +++ b/.github/workflows/standalone.yml @@ -5,10 +5,12 @@ on: branches: [ '*' ] pull_request: branches: [ "main" ] - -jobs: +jobs: + coding_style_tests: + uses: ./.github/workflows/coding_style.yml standalone_macos_intel: + needs: [coding_style_tests] runs-on: macos-13 strategy: fail-fast: false @@ -28,6 +30,7 @@ jobs: fi' standalone_linux_intel: + needs: [coding_style_tests] runs-on: ubuntu-latest strategy: fail-fast: false diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 56a5d1c4..2483ab54 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -6,6 +6,8 @@ permissions: contents: read jobs: + coding_style_tests: + uses: ./.github/workflows/coding_style.yml cygwin: # Run a job for each of the specified target architectures: strategy: @@ -19,6 +21,7 @@ jobs: # - arch: win32 # config: --strict-warnings no-fips enable-quic runs-on: ${{matrix.os}} + needs: [coding_style_tests] env: CYGWIN_NOWINPATH: 1 SHELLOPTS: igncr @@ -107,6 +110,7 @@ jobs: # oqsconfig: -DOQS_ALGS_ENABLED=STD # osslconfig: --strict-warnings no-fips enable-quic runs-on: ${{matrix.os}} + needs: [coding_style_tests] steps: - name: Restore OpenSSL32 cache id: cache-openssl32 @@ -212,7 +216,7 @@ jobs: - arch: win64 oqsconfig: -DOQS_ALGS_ENABLED=STD osslconfig: no-shared no-fips VC-WIN64A - toolchain: + toolchain: - .CMake/toolchain_windows_amd64.cmake msarch: - x64 @@ -220,6 +224,7 @@ jobs: - Debug - Release runs-on: ${{matrix.os}} + needs: [coding_style_tests] steps: - name: Restore native OpenSSL32 cache id: cache-openssl32n @@ -261,7 +266,7 @@ jobs: run: | cmake --version cmake -B build --toolchain ${{ matrix.toolchain }} . - cmake --build build + cmake --build build cmake --build build --target INSTALL working-directory: liboqs - name: prepare the OpenSSL build directory @@ -305,4 +310,4 @@ jobs: with: name: oqs-provider-msvc path: D:/a/oqs-provider/oqs-provider/_build/lib/oqsprovider.dll - +