Skip to content

Commit

Permalink
Use Github Actions for some CI (#1069)
Browse files Browse the repository at this point in the history
* Disable other CI's on ghactionsonly- branches

* Stylecheck in Github Actions

* Add runs-on

* Add buildcheck in Github Actions

* Typo

* Debugging

* Debugging environment variables

* More debugging

* Add alpine job in Github Actions

* Debugging

* Debugging

* More debugging

* Add alpine-noopenssl job in Github Actions

* Alpine as a strategy matrix

* Debugging strategy matrix

* Reorganize strategy matrix

* Add ARM emulated job in Github Actions

* Finalize initial move to Github Actions

* Skip alg info test on ARM emulated
  • Loading branch information
dstebila authored Aug 12, 2021
1 parent 6f64980 commit b803b54
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 96 deletions.
101 changes: 5 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,56 +118,6 @@ jobs:
- store_artifacts:
path: build/test-results

arm_emulated:
description: A template for running liboqs tests on emulated ARM Docker VMs
parameters:
ARCH:
description: "The desired ARM architecture to be emulated."
type: string
CMAKE_ARGS:
description: "Arguments to pass to CMake."
type: string
PYTEST_ARGS:
description: "Arguments to pass to pytest."
type: string
machine:
image: ubuntu-1604:201903-01
steps:
- checkout
- run:
name: Install the emulation handlers
command: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- run:
name: Build in an x86_64 container
command: |2
docker run --rm \
-v `pwd`:`pwd` \
-w `pwd` \
openquantumsafe/ci-debian-buster-amd64:latest /bin/bash \
-c "mkdir build && \
(cd build && \
cmake .. -GNinja << parameters.CMAKE_ARGS >> \
-DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_<< parameters.ARCH >>.cmake && \
cmake -LA .. && \
ninja)"
- run:
name: Run the tests in an << parameters.ARCH >> container
command: |2
docker run --rm -e SKIP_TESTS=style,mem_kem,mem_sig \
-v `pwd`:`pwd` \
-w `pwd` \
openquantumsafe/ci-debian-buster-<< parameters.ARCH >>:latest /bin/bash \
-c "mkdir -p tmp && \
python3 -m pytest --verbose \
--numprocesses=auto \
<< parameters.PYTEST_ARGS >> \
--ignore=tests/test_code_conventions.py \
--junitxml=build/test-results/pytest/test-results.xml"
- store_test_results:
path: build/test-results
- store_artifacts:
path: build/test-results

arm_machine:
description: A template for running liboqs tests on ARM(presently only 64) machines
parameters:
Expand Down Expand Up @@ -322,8 +272,11 @@ workflows:
version: 2.1
build:
when:
not:
equal: [ main, << pipeline.git.branch >> ]
and:
- not:
equal: [ main, << pipeline.git.branch >> ]
- not:
matches: { pattern: "^ghactionsonly-.*", value: << pipeline.git.branch >> }
jobs:
- stylecheck
- buildcheck:
Expand All @@ -336,20 +289,6 @@ workflows:
#- testapproval:
# <<: *require_buildcheck
# type: approval
- linux_oqs:
<<: *require_buildcheck
name: alpine-noopenssl
context: openquantumsafe
CONTAINER: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=OFF
PYTEST_ARGS: --ignore=tests/test_alg_info.py
- linux_oqs:
<<: *require_buildcheck
name: alpine
context: openquantumsafe
CONTAINER: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON
PYTEST_ARGS: --ignore=tests/test_alg_info.py
# Disabling centos-8 and debian-buster.
# Re-enable if specific configurations (package versions etc) that need to be tested are identified.
#- linux_oqs:
Expand Down Expand Up @@ -382,17 +321,6 @@ workflows:
context: openquantumsafe
CONTAINER: openquantumsafe/ci-ubuntu-focal-x86_64:latest
CMAKE_ARGS: -DCMAKE_C_COMPILER=clang-9
- linux_oqs:
<<: *require_buildcheck
name: address-sanitizer
context: openquantumsafe
filters:
branches:
only:
- /^audit.*/
CONTAINER: openquantumsafe/ci-ubuntu-focal-x86_64:latest
CMAKE_ARGS: -DCMAKE_C_COMPILER=clang-9 -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZER=Address
PYTEST_ARGS: --ignore=tests/test_portability.py --numprocesses=auto --maxprocesses=10
- linux_oqs:
<<: *require_buildcheck
name: ubuntu-bionic-i386
Expand Down Expand Up @@ -433,30 +361,11 @@ workflows:
# PYTEST_ARGS: --numprocesses=1
# SPHINCS exhausts memory on CircleCI servers
# for these configurations.
# don't run ARM64 emulated any more:
#- arm_emulated:
# <<: *require_buildcheck
# name: arm64
# ARCH: arm64
# CMAKE_ARGS: -DOQS_ENABLE_SIG_SPHINCS=OFF -DOQS_DIST_BUILD=ON
- arm_machine:
<<: *require_buildcheck
name: arm64
PYTEST_ARGS: --numprocesses=auto --maxprocesses=10
CMAKE_ARGS: -DOQS_DIST_BUILD=ON
- arm_emulated:
<<: *require_buildcheck
name: armhf
ARCH: armhf
CMAKE_ARGS: -DOQS_ENABLE_SIG_SPHINCS=OFF -DOQS_USE_OPENSSL=OFF -DOQS_OPT_TARGET=generic
PYTEST_ARGS: --ignore=tests/test_alg_info.py
# Disabling armel
#- arm_emulated:
# <<: *require_buildcheck
# name: armel
# ARCH: armel
# CMAKE_ARGS: -DOQS_ENABLE_SIG_SPHINCS=OFF -DOQS_USE_OPENSSL=OFF -DOQS_OPT_TARGET=generic

- macOS:
<<: *require_buildcheck
name: macOS-noopenssl
Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Linux tests

on: [push]

jobs:

stylecheck:
name: Check code formatting
container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Ensure code conventions are upheld
run: python3 -m pytest --verbose tests/test_code_conventions.py
- name: Check that doxygen can parse the documentation
run: mkdir -p build/docs && doxygen docs/.Doxyfile

buildcheck:
name: Check that code passes a basic build before starting heavier tests
container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
needs: stylecheck
runs-on: ubuntu-latest
env:
KEM_NAME: kyber_768
SIG_NAME: dilithium_3
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
run: |
mkdir build && \
cd build && \
cmake .. --warn-uninitialized \
-GNinja \
-DOQS_MINIMAL_BUILD="OQS_ENABLE_KEM_$KEM_NAME;OQS_ENABLE_SIG_$SIG_NAME" \
> config.log 2>&1 && \
cat config.log && \
cmake -LA .. && \
! (grep "uninitialized variable" config.log)
- name: Build
run: ninja
working-directory: build

linux_intel:
needs: [stylecheck, buildcheck]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: alpine
container: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=ON -DBUILD_SHARED_LIBS=ON
PYTEST_ARGS: --ignore=tests/test_alg_info.py
- name: alpine-noopenssl
container: openquantumsafe/ci-alpine-amd64:latest
CMAKE_ARGS: -DOQS_USE_OPENSSL=OFF
PYTEST_ARGS: --ignore=tests/test_alg_info.py
# disabled until #1067 lands
# - name: address-sanitizer
# container: openquantumsafe/ci-ubuntu-focal-x86_64:latest
# CMAKE_ARGS: -DCMAKE_C_COMPILER=clang-9 -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZER=Address
# PYTEST_ARGS: --ignore=tests/test_portability.py --numprocesses=auto --maxprocesses=10
container:
image: ${{ matrix.container }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Configure
run: mkdir build && cd build && cmake -GNinja ${{ matrix.CMAKE_ARGS }} .. && cmake -LA ..
- name: Build
run: ninja
working-directory: build
- name: Run tests
timeout-minutes: 60
run: mkdir -p tmp && python3 -m pytest --verbose --ignore=tests/test_code_conventions.py ${{ matrix.PYTEST_ARGS }}

linux_arm_emulated:
needs: [stylecheck, buildcheck]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: armhf
ARCH: armhf
CMAKE_ARGS: -DOQS_ENABLE_SIG_SPHINCS=OFF -DOQS_USE_OPENSSL=OFF -DOQS_OPT_TARGET=generic
PYTEST_ARGS: --ignore=tests/test_alg_info.py
# no longer supporting armel
# - name: armel
# ARCH: armel
# CMAKE_ARGS: -DOQS_ENABLE_SIG_SPHINCS=OFF -DOQS_USE_OPENSSL=OFF -DOQS_OPT_TARGET=generic
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install the emulation handlers
run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Build in an x86_64 container
run: |
docker run --rm \
-v `pwd`:`pwd` \
-w `pwd` \
openquantumsafe/ci-debian-buster-amd64:latest /bin/bash \
-c "mkdir build && \
(cd build && \
cmake .. -GNinja ${{ matrix.CMAKE_ARGS }} \
-DCMAKE_TOOLCHAIN_FILE=../.CMake/toolchain_${{ matrix.ARCH }}.cmake && \
cmake -LA .. && \
ninja)"
- name: Run the tests in an ${{ matrix.ARCH }} container
timeout-minutes: 60
run: |
docker run --rm -e SKIP_TESTS=style,mem_kem,mem_sig \
-v `pwd`:`pwd` \
-w `pwd` \
openquantumsafe/ci-debian-buster-${{ matrix.ARCH }}:latest /bin/bash \
-c "mkdir -p tmp && \
python3 -m pytest --verbose \
--numprocesses=auto \
--ignore=tests/test_code_conventions.py ${{ matrix.PYTEST_ARGS }}"
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
os: linux # required for arch different than amd64
dist: focal # or bionic | xenial with xenial as default
compiler: gcc
if: NOT branch =~ /^ghactionsonly-/
script:
- mkdir build && cd build && cmake -GNinja .. && cmake -LA .. && ninja
- cd build & ninja run_tests
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ platform: x64
branches:
except:
- /main-new-.*/
- /ghactionsonly-.*/

environment:
matrix:
Expand Down

0 comments on commit b803b54

Please sign in to comment.