diff options
| author | Ján Jančár | 2024-03-27 17:44:43 +0100 |
|---|---|---|
| committer | GitHub | 2024-03-27 17:44:43 +0100 |
| commit | 14bb8dce2ec147970c3ad1d0433d59b0e0c55450 (patch) | |
| tree | d269c72270caa8123620c0a10e3ae99de7c24284 /.github/workflows | |
| parent | 96f21ccff6cc3daa5728e4700459d655238f5b93 (diff) | |
| parent | 88e480904c24d4c93ef6420acb6bf92ae95871af (diff) | |
| download | ECTester-14bb8dce2ec147970c3ad1d0433d59b0e0c55450.tar.gz ECTester-14bb8dce2ec147970c3ad1d0433d59b0e0c55450.tar.zst ECTester-14bb8dce2ec147970c3ad1d0433d59b0e0c55450.zip | |
Merge pull request #21 from crocs-muni/feat/codecov
Add code coverage measurement.
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build.yml | 122 |
1 files changed, 104 insertions, 18 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb4b902..d3e45cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,18 +7,92 @@ on: branches: [ "master" ] jobs: - build: - + applet: runs-on: ubuntu-latest permissions: contents: read strategy: matrix: - java: [ "8", "11", "17", "21" ] + java: [ "8", "11", "17"] env: JAVA_VERSION: ${{ matrix.java }} - name: Build Java ${{ 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: @@ -40,60 +114,72 @@ jobs: 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: Build applets - run: if [ $JAVA_VERSION != 21 ]; then ./gradlew applet:buildJavaCard; fi - - - name: Build reader - run: ./gradlew reader:uberJar + echo "WOLFCRYPT_VERSION=$(git submodule status ext/wolfcrypt-jni | cut -f2 -d' ')" >> $GITHUB_ENV + echo "WOLFSSL_VERSION=$(dpkg -s libwolfssl-dev | grep 'Version' | 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 }} + key: libs-${{ env.BORINGSSL_VERSION }}-${{ env.LIBRESSL_VERSION }}-${{ env.IPPCP_VERSION }}-${{ env.WOLFCRYPT_VERSION }}-${{ env.WOLFSSL_VERSION }} path: | ext/boringssl/build/crypto/libcrypto.so ext/libressl/build/crypto/libcrypto.so ext/ipp-crypto/build/.build/RELEASE/lib/libippcp.so + ext/wolfcrypt-jni/lib/wolfcrypt-jni.jar + ext/wolfcrypt-jni/lib/libwolfcryptjni.so - name: Build libs if: steps.cache-libs.outputs.cache-hit != 'true' run: | + # ------------ Build BoringSSL ------------ cd ext/boringssl cmake -DBUILD_SHARED_LIBS=1 -Bbuild cd build make -j4 crypto cd ../../.. + # ------------ Build LibreSSL ------------ cd ext/libressl ./autogen.sh cmake -DBUILD_SHARED_LIBS=ON -Bbuild cd build make -j4 crypto cd ../../.. + # ------------ Build IPP-crypto ------------ cd ext/ipp-crypto CC=clang CXX=clang++ cmake CMakeLists.txt -Bbuild -DARCH=intel64 cd build make -j4 cd ../../.. + # ------------ Build wolfcrypt-jni ------------ + cd ext/wolfcrypt-jni + mkdir junit + wget -P junit/ https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar + wget -P junit/ https://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar + make -j4 -f makefile.linux + env JUNIT_HOME=junit/ ant build-jce-release + cd ../../.. - name: Build standalone run: | ./gradlew standalone:libs || true ./gradlew standalone:uberJar - # ffs: https://github.com/adoptium/adoptium-support/issues/485 !!! - name: List libraries - run: env LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/" ./gradlew standalone:run --args="list-libs" + run: ./gradlew standalone:run --args="list-libs" - name: Test - run: ./gradlew test + run: ./gradlew standalone:test - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: built-${{ matrix.java }} + name: built-standalone-${{ matrix.java }} path: | - applet/build/javacard/*.cap - reader/build/libs/ECTesterReader.jar - standalone/build/libs/ECTesterStandalone.jar
\ No newline at end of file + standalone/build/libs/ECTesterStandalone.jar + + - name: Upload code coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: crocs-muni/ECTester
\ No newline at end of file |
