Skip to content

Commit

Permalink
Move the clang-format check from CircleCI to GitHub actions. (open-qu…
Browse files Browse the repository at this point in the history
…antum-safe#376)

Related to open-quantum-safe#248.

Signed-off-by: thb-sb <[email protected]>
  • Loading branch information
thomas authored Mar 20, 2024
1 parent 37769c9 commit 66ee770
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 22 deletions.
14 changes: 0 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/coding_style.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 9 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -30,6 +32,7 @@ jobs:

linux_intel:
runs-on: ubuntu-latest
needs: [coding_style_tests]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -79,6 +82,7 @@ jobs:
asan_linux_intel:
name: "Security checks"
runs-on: ubuntu-latest
needs: [coding_style_tests]
strategy:
fail-fast: false
container:
Expand Down Expand Up @@ -154,6 +158,7 @@ jobs:
linux_aarch64:
name: "aarch64 cross-compilation"
runs-on: ubuntu-latest
needs: [coding_style_tests]
strategy:
fail-fast: false
container:
Expand Down Expand Up @@ -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

5 changes: 4 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,6 +30,7 @@ jobs:
fi'
standalone_linux_intel:
needs: [coding_style_tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -212,14 +216,15 @@ jobs:
- arch: win64
oqsconfig: -DOQS_ALGS_ENABLED=STD
osslconfig: no-shared no-fips VC-WIN64A
toolchain:
toolchain:
- .CMake/toolchain_windows_amd64.cmake
msarch:
- x64
type:
- Debug
- Release
runs-on: ${{matrix.os}}
needs: [coding_style_tests]
steps:
- name: Restore native OpenSSL32 cache
id: cache-openssl32n
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -305,4 +310,4 @@ jobs:
with:
name: oqs-provider-msvc
path: D:/a/oqs-provider/oqs-provider/_build/lib/oqsprovider.dll

0 comments on commit 66ee770

Please sign in to comment.