Add code coverage measurement. #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
applet: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
java: [ "8", "11", "17"] | |
env: | |
JAVA_VERSION: ${{ matrix.java }} | |
name: Build applet with Java ${{ matrix.java }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: "temurin" | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build applets | |
run: ./gradlew applet:buildJavaCard | |
- name: Test | |
run: ./gradlew applet:test | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-applet-${{ matrix.java }} | |
path: | | |
applet/build/javacard/*.cap | |
reader: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
java: [ "11", "17", "21" ] | |
name: Build reader on Java ${{ matrix.java }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: "temurin" | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Build reader | |
run: ./gradlew reader:uberJar | |
- name: Test | |
run: ./gradlew reader:test | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-reader-${{ matrix.java }} | |
path: | | |
reader/build/libs/ECTesterReader.jar | |
standalone: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
strategy: | |
matrix: | |
java: [ "11", "17", "21" ] | |
env: | |
# ffs: https://github.com/adoptium/adoptium-support/issues/485 !!! | |
LD_LIBRARY_PATH: "/usr/lib/x86_64-linux-gnu/" | |
name: Build standalone on Java ${{ matrix.java }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: "temurin" | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Setup libraries | |
run: | | |
sudo apt update | |
sudo apt install libmbedtls-dev libtomcrypt-dev libtommath-dev libssl-dev libcrypto++-dev libgcrypt20-dev nettle-dev libbotan-2-dev libwolfssl-dev nasm | |
echo "BORINGSSL_VERSION=$(git submodule status ext/boringssl | cut -f2 -d' ')" >> $GITHUB_ENV | |
echo "LIBRESSL_VERSION=$(git submodule status ext/libressl | cut -f2 -d' ')" >> $GITHUB_ENV | |
echo "IPPCP_VERSION=$(git submodule status ext/ipp-crypto | cut -f2 -d' ')" >> $GITHUB_ENV | |
- name: Cache libs | |
uses: actions/cache@v4 | |
id: cache-libs | |
with: | |
key: libs-${{ env.BORINGSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.IPPCP_VERSION }} | |
path: | | |
ext/boringssl/build/crypto/libcrypto.so | |
ext/libressl/build/crypto/libcrypto.so | |
ext/ipp-crypto/build/.build/RELEASE/lib/libippcp.so | |
- name: Build libs | |
if: steps.cache-libs.outputs.cache-hit != 'true' | |
run: | | |
cd ext/boringssl | |
cmake -DBUILD_SHARED_LIBS=1 -Bbuild | |
cd build | |
make -j4 crypto | |
cd ../../.. | |
cd ext/libressl | |
./autogen.sh | |
cmake -DBUILD_SHARED_LIBS=ON -Bbuild | |
cd build | |
make -j4 crypto | |
cd ../../.. | |
cd ext/ipp-crypto | |
CC=clang CXX=clang++ cmake CMakeLists.txt -Bbuild -DARCH=intel64 | |
cd build | |
make -j4 | |
cd ../../.. | |
- name: Build standalone | |
run: | | |
./gradlew standalone:libs || true | |
./gradlew standalone:uberJar | |
- name: List libraries | |
run: ./gradlew standalone:run --args="list-libs" | |
- name: Test | |
run: ./gradlew standalone:test | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-standalone-${{ matrix.java }} | |
path: | | |
standalone/build/libs/ECTesterStandalone.jar | |
- name: Upload code coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: crocs-muni/ECTester |