From 5a905eab333650aee9af6d7f9e42f8bb348e30df Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Fri, 13 Dec 2024 17:26:47 -0500 Subject: [PATCH 1/7] Add basic GitHub Actions workflow Signed-off-by: Spencer Wilson --- .github/workflows/java.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/java.yml diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml new file mode 100644 index 0000000..5bc41b4 --- /dev/null +++ b/.github/workflows/java.yml @@ -0,0 +1,38 @@ +name: liboqs-java CI + +jobs: + workflowcheck: + name: Check validity of GitHub workflows + runs-on: ubuntu-latest + container: openquantumsafe/ci-ubuntu-latest:latest + steps: + - name: Checkout code + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + - name: Ensure GitHub actions are valid + run: actionlint -shellcheck "" # run *without* shellcheck + + build-and-test: + name: Build and test + runs-on: ubuntu-latest + container: openquantumsafe/ci-ubuntu-latest:latest + steps: + - name: Checkout liboqs-java + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + - name: Checkout liboqs main + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + with: + repository: open-quantum-safe/liboqs + path: liboqs + ref: main + - name: Build liboqs + run: mkdir build && cd build && cmake .. -G"Ninja" -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON && ninja install + working-directory: liboqs + - name: Resolve all maven project dependencies + run: mvn dependency:go-offline + - name: Build liboqs-java and run tests + run: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && mvn package + - name: Compile KEM, Signatures and Rand examples + run: | + javac -cp target/liboqs-java.jar examples/KEMExample.java && + javac -cp target/liboqs-java.jar examples/SigExample.java && + javac -cp target/liboqs-java.jar examples/RandExample.java From 39c93e18f70b26d42cd0e0466f3c74fad54b5f83 Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Fri, 13 Dec 2024 17:44:42 -0500 Subject: [PATCH 2/7] Add OpenJDK workflow Signed-off-by: Spencer Wilson --- .github/workflows/java.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 5bc41b4..fcaf652 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -11,8 +11,9 @@ jobs: - name: Ensure GitHub actions are valid run: actionlint -shellcheck "" # run *without* shellcheck - build-and-test: - name: Build and test + ubuntu-build: + needs: workflowcheck + name: OQS Ubuntu runs-on: ubuntu-latest container: openquantumsafe/ci-ubuntu-latest:latest steps: @@ -36,3 +37,32 @@ jobs: javac -cp target/liboqs-java.jar examples/KEMExample.java && javac -cp target/liboqs-java.jar examples/SigExample.java && javac -cp target/liboqs-java.jar examples/RandExample.java + + openjdk-11: + needs: workflowcheck + name: OpenJDK + runs-on: ubuntu-latest + container: cimg/openjdk:11.0.9 + steps: + - name: Install dependencies to build liboqs + run: sudo apt update -qq && sudo apt install cmake build-essential ninja-build libssl-dev + - name: Checkout liboqs-java + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + - name: Checkout liboqs main + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 + with: + repository: open-quantum-safe/liboqs + path: liboqs + ref: main + - name: Build liboqs + run: mkdir build && cd build && cmake .. -G"Ninja" -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON && ninja install + working-directory: liboqs + - name: Resolve all maven project dependencies + run: mvn dependency:go-offline + - name: Build liboqs-java and run tests + run: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && mvn package + - name: Compile KEM, Signatures and Rand examples + run: | + javac -cp target/liboqs-java.jar examples/KEMExample.java && + javac -cp target/liboqs-java.jar examples/SigExample.java && + javac -cp target/liboqs-java.jar examples/RandExample.java From a1b961f989824d6267a0a6d1ee86dea7912bb55a Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Fri, 13 Dec 2024 17:45:12 -0500 Subject: [PATCH 3/7] Remove CircleCI config Signed-off-by: Spencer Wilson --- .circleci/config.yml | 88 -------------------------------------------- 1 file changed, 88 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5e49da8..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,88 +0,0 @@ -version: 2.1 - -jobs: - ubuntu_build: - description: A template for running liboqs-java tests on the OQS x64 Ubuntu Bionic Docker VM - docker: - - image: openquantumsafe/ci-ubuntu-focal-x86_64:latest - auth: - username: $DOCKER_LOGIN - password: $DOCKER_PASSWORD - steps: - - checkout # change this from "checkout" to "*localCheckout" when running CircleCI locally - - run: - name: Clone liboqs - command: git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs.git - - run: - name: Build liboqs - command: mkdir build && cd build && cmake .. -G"Ninja" -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON && ninja install - working_directory: liboqs - - run: - name: Resolve all maven project dependencies - command: mvn dependency:go-offline - - run: - name: Build liboqs-java and run tests - command: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && mvn package - - run: - name: Compile KEM, Signatures and Rand examples - command: > - javac -cp target/liboqs-java.jar examples/KEMExample.java && - javac -cp target/liboqs-java.jar examples/SigExample.java && - javac -cp target/liboqs-java.jar examples/RandExample.java - - run: - name: Run KEM, Signatures and Rand examples - command: > - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && - java -Djava.library.path=target/ -cp target/liboqs-java.jar:examples/ KEMExample && - java -Djava.library.path=target/ -cp target/liboqs-java.jar:examples/ SigExample && - java -Djava.library.path=target/ -cp target/liboqs-java.jar:examples/ RandExample - - openjdk-11: - description: A template for running liboqs-java tests on the CircleCI OpenJDK VM - docker: - - image: cimg/openjdk:11.0.9 - auth: - username: $DOCKER_LOGIN - password: $DOCKER_PASSWORD - steps: - - checkout # change this from "checkout" to "*localCheckout" when running CircleCI locally - - run: - name: Install dependencies to build liboqs - command: sudo apt update -qq && sudo apt install cmake build-essential ninja-build libssl-dev - - run: - name: Clone liboqs - command: git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs.git - - run: - name: Build liboqs - command: mkdir build && cd build && cmake .. -G"Ninja" -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON && sudo ninja install - working_directory: liboqs - - run: - name: Resolve all maven project dependencies - command: mvn dependency:go-offline - - run: - name: Build liboqs-java and run tests - command: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && mvn package - - run: - name: Compile KEM, Signatures and Rand examples - command: > - javac -cp target/liboqs-java.jar examples/KEMExample.java && - javac -cp target/liboqs-java.jar examples/SigExample.java && - javac -cp target/liboqs-java.jar examples/RandExample.java - - run: - name: Run KEM, Signatures and Rand examples - command: > - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && - java -Djava.library.path=target/ -cp target/liboqs-java.jar:examples/ KEMExample && - java -Djava.library.path=target/ -cp target/liboqs-java.jar:examples/ SigExample && - java -Djava.library.path=target/ -cp target/liboqs-java.jar:examples/ RandExample - -workflows: - version: 2.1 - build: - jobs: - - ubuntu_build: - name: ubuntu-build - context: openquantumsafe - - openjdk-11: - name: openjdk-11 - context: openquantumsafe From e10d1fc24b092faa832be32cddb5e774cd67ac5d Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Mon, 16 Dec 2024 11:37:59 -0500 Subject: [PATCH 4/7] fixup! Add basic GitHub Actions workflow Signed-off-by: Spencer Wilson --- .github/workflows/java.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index fcaf652..617035e 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -1,5 +1,13 @@ name: liboqs-java CI +on: + push: + branches: ["**"] + pull_request: + branches: ["**"] + repository_dispatch: + types: ["**"] + jobs: workflowcheck: name: Check validity of GitHub workflows From 85dce308d292c40a95621bb8b252cc681831a0e6 Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Mon, 16 Dec 2024 11:48:33 -0500 Subject: [PATCH 5/7] Use Focal container, remove OpenJDK container run Signed-off-by: Spencer Wilson --- .github/workflows/java.yml | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index 617035e..bf62c52 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -12,18 +12,18 @@ jobs: workflowcheck: name: Check validity of GitHub workflows runs-on: ubuntu-latest - container: openquantumsafe/ci-ubuntu-latest:latest + container: openquantumsafe/ci-ubuntu-focal:latest steps: - name: Checkout code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 - name: Ensure GitHub actions are valid run: actionlint -shellcheck "" # run *without* shellcheck - ubuntu-build: + build-and-test: needs: workflowcheck name: OQS Ubuntu runs-on: ubuntu-latest - container: openquantumsafe/ci-ubuntu-latest:latest + container: openquantumsafe/ci-ubuntu-focal:latest steps: - name: Checkout liboqs-java uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 @@ -45,32 +45,3 @@ jobs: javac -cp target/liboqs-java.jar examples/KEMExample.java && javac -cp target/liboqs-java.jar examples/SigExample.java && javac -cp target/liboqs-java.jar examples/RandExample.java - - openjdk-11: - needs: workflowcheck - name: OpenJDK - runs-on: ubuntu-latest - container: cimg/openjdk:11.0.9 - steps: - - name: Install dependencies to build liboqs - run: sudo apt update -qq && sudo apt install cmake build-essential ninja-build libssl-dev - - name: Checkout liboqs-java - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 - - name: Checkout liboqs main - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 - with: - repository: open-quantum-safe/liboqs - path: liboqs - ref: main - - name: Build liboqs - run: mkdir build && cd build && cmake .. -G"Ninja" -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON && ninja install - working-directory: liboqs - - name: Resolve all maven project dependencies - run: mvn dependency:go-offline - - name: Build liboqs-java and run tests - run: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" && mvn package - - name: Compile KEM, Signatures and Rand examples - run: | - javac -cp target/liboqs-java.jar examples/KEMExample.java && - javac -cp target/liboqs-java.jar examples/SigExample.java && - javac -cp target/liboqs-java.jar examples/RandExample.java From 9151786f1b640513476a3b9b06a70fb2f363c84e Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Mon, 16 Dec 2024 11:54:12 -0500 Subject: [PATCH 6/7] fixup! Use Focal container, remove OpenJDK container run Signed-off-by: Spencer Wilson --- .github/workflows/java.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml index bf62c52..19c3dff 100644 --- a/.github/workflows/java.yml +++ b/.github/workflows/java.yml @@ -12,7 +12,7 @@ jobs: workflowcheck: name: Check validity of GitHub workflows runs-on: ubuntu-latest - container: openquantumsafe/ci-ubuntu-focal:latest + container: openquantumsafe/ci-ubuntu-latest:latest steps: - name: Checkout code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@v4 From bca1174930c93c0807ce1927ff69b2ce67f4043f Mon Sep 17 00:00:00 2001 From: Spencer Wilson Date: Mon, 16 Dec 2024 13:55:39 -0500 Subject: [PATCH 7/7] Update README badge [skip ci] Signed-off-by: Spencer Wilson --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f2472a..224df6a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CircleCI Build Status](https://circleci.com/gh/open-quantum-safe/liboqs-java/tree/master.svg?style=svg)](https://circleci.com/gh/open-quantum-safe/liboqs-java/tree/master) +[![GitHub Actions Build Status](https://github.com/open-quantum-safe/liboqs-java/actions/workflows/java.yml/badge.svg)](https://github.com/open-quantum-safe/liboqs-java/actions/workflows/java.yml) # liboqs-java: Java wrapper for liboqs