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 diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml new file mode 100644 index 0000000..19c3dff --- /dev/null +++ b/.github/workflows/java.yml @@ -0,0 +1,47 @@ +name: liboqs-java CI + +on: + push: + branches: ["**"] + pull_request: + branches: ["**"] + repository_dispatch: + types: ["**"] + +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: + needs: workflowcheck + name: OQS Ubuntu + runs-on: ubuntu-latest + container: openquantumsafe/ci-ubuntu-focal: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 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