diff --git a/.github/actions/install/cmake/action.yml b/.github/actions/install/cmake/action.yml index a018583f..7af44276 100644 --- a/.github/actions/install/cmake/action.yml +++ b/.github/actions/install/cmake/action.yml @@ -15,7 +15,7 @@ runs: uses: actions/cache@v3 with: path: cmake-${{ inputs.version }} - key: ${{ runner.name }}-${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }} + key: ${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-cmake-${{ inputs.version }} - name: Build cmake if: steps.cache-cmake.outputs.cache-hit != 'true' run: | diff --git a/.github/actions/install/libressl/action.yml b/.github/actions/install/libressl/action.yml index 709ad701..7bd5679c 100644 --- a/.github/actions/install/libressl/action.yml +++ b/.github/actions/install/libressl/action.yml @@ -4,7 +4,7 @@ inputs: version: description: The desired LibreSSL version to install required: false - default: "3.3.0" + default: "3.5.4" runs: using: composite steps: diff --git a/.github/actions/install/openssl/action.yml b/.github/actions/install/openssl/action.yml index 83c03a29..10077004 100644 --- a/.github/actions/install/openssl/action.yml +++ b/.github/actions/install/openssl/action.yml @@ -4,18 +4,57 @@ inputs: version: description: The desired OpenSSL version to install required: false - default: "openssl-3.0.0" + default: "openssl-3.3.0" runs: using: composite steps: - - run: | - cd /tmp + - name: Cache CMake + id: cache-openssl + uses: actions/cache@v4 + with: + path: openssl-${{ inputs.version }} + key: ${{ runner.os }}-${{ runner.arch }}-${{ job.container.id }}-openssl-${{ inputs.version }} + + - uses: ilammy/setup-nasm@v1 + - if: runner.os == 'Windows' && steps.cache-openssl.outputs.cache-hit != 'true' + shell: powershell + run: | + Invoke-WebRequest -OutFile ${{ inputs.version }}.tar.gz -Uri https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz + - if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + - if: runner.os == 'Windows' && steps.cache-openssl.outputs.cache-hit != 'true' + shell: cmd + run: | + tar -zxf ${{ inputs.version }}.tar.gz + cd openssl-${{ inputs.version }} + perl Configure VC-WIN64A --prefix=${{ github.workspace }}\openssl + nmake + - if: runner.os == 'Windows' + shell: cmd + run: | + cd openssl-${{ inputs.version }} + nmake install + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + + - if: runner.os == 'Linux' && steps.cache-openssl.outputs.cache-hit != 'true' + shell: bash + run: | wget https://github.com/openssl/openssl/archive/refs/tags/${{ inputs.version }}.tar.gz - tar -zxf /tmp/${{ inputs.version }}.tar.gz + tar -zxf ./${{ inputs.version }}.tar.gz cd openssl-${{ inputs.version }} - ./config --prefix=/tmp --libdir=lib + + # Check version using major number comparison + if [[ "${{ inputs.version }}" -ge "3.0.0" ]]; then + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib no-tests + else + ./config --prefix=${{ github.workspace }}/openssl --libdir=lib + fi make -j $(nproc) - sudo make -j $(nproc) install_sw - echo "OPENSSL_ROOT_DIR=/tmp" >> "$GITHUB_ENV" - echo "OpenSSL_ROOT=/tmp" >> "$GITHUB_ENV" + - if: runner.os == 'Linux' shell: bash + run: | + cd openssl-${{ inputs.version }} + sudo make -j $(nproc) install_sw + echo "OPENSSL_ROOT_DIR=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" + echo "OpenSSL_ROOT=${{ github.workspace }}/openssl" >> "$GITHUB_ENV" diff --git a/.github/actions/install/wolfssl/action.yml b/.github/actions/install/wolfssl/action.yml index bced1474..dc923701 100644 --- a/.github/actions/install/wolfssl/action.yml +++ b/.github/actions/install/wolfssl/action.yml @@ -4,7 +4,7 @@ inputs: version: description: The desired stable wolfSSL version to install required: false - default: "v4.8.1-stable" + default: "v5.6.6-stable" runs: using: composite steps: diff --git a/.github/workflows/cross-platform.yml b/.github/workflows/cross-platform.yml index a4f23a35..600cd1c4 100644 --- a/.github/workflows/cross-platform.yml +++ b/.github/workflows/cross-platform.yml @@ -14,7 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: configure run: cmake --preset examples diff --git a/.github/workflows/jwt.yml b/.github/workflows/jwt.yml index 46eed971..718dc51a 100644 --- a/.github/workflows/jwt.yml +++ b/.github/workflows/jwt.yml @@ -51,8 +51,8 @@ jobs: fail-fast: false matrix: openssl: - - { tag: "openssl-3.0.5", name: "3.0.5" } - - { tag: "OpenSSL_1_1_1q", name: "1.1.1q" } + - { tag: "openssl-3.3.0", name: "3.3.0" } + - { tag: "OpenSSL_1_1_1w", name: "1.1.1w" } steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest diff --git a/.github/workflows/ssl.yml b/.github/workflows/ssl.yml index 4942653c..caef8678 100644 --- a/.github/workflows/ssl.yml +++ b/.github/workflows/ssl.yml @@ -8,35 +8,48 @@ on: jobs: openssl: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: + os: [windows-latest, ubuntu-latest] openssl: - - { tag: "openssl-3.0.5", name: "3.0.5" } - - { tag: "OpenSSL_1_1_1q", name: "1.1.1q" } - - { tag: "OpenSSL_1_1_0i", name: "1.1.0i" } # Do not bump, there's a broken in the autoconfig script and it's not maintained - - { tag: "OpenSSL_1_0_2u", name: "1.0.2u" } - - { tag: "OpenSSL_1_0_1u", name: "1.0.1u" } - name: OpenSSL ${{ matrix.openssl.name }} + - "3.3.0" + - "3.2.1" + - "3.1.5" + - "3.0.13" + - "1.1.1w" + - "1.1.0i" # Do not bump, there's a broken in the autoconfig script and it's not maintained + - "1.0.2u" + - "1.0.1u" + exclude: + # The older version of OpenSSL were less cross-platform friendly, the Windows build had a seperate set of build + # scripts but it's just a pain to support them, see the failed attempt: + # https://github.com/prince-chrismc/jwt-cpp/pull/35/commits/e4948d2e1b7ec03896f80669fab6f9a2edf7ea63 + - os: windows-latest + openssl: "1.1.0i" + - os: windows-latest + openssl: "1.0.2u" + - os: windows-latest + openssl: "1.0.1u" + name: OpenSSL ${{ matrix.openssl }} - ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: lukka/get-cmake@latest - - uses: ./.github/actions/install/gtest - uses: ./.github/actions/install/openssl with: - version: ${{ matrix.openssl.tag }} - + version: ${{ fromJson('{"3.3.0":"openssl-3.3.0","3.2.1":"openssl-3.2.1","3.1.5":"openssl-3.1.5","3.0.13":"openssl-3.0.13","1.1.1w":"OpenSSL_1_1_1w","1.1.0i":"OpenSSL_1_1_0i","1.0.2u":"OpenSSL_1_0_2u","1.0.1u":"OpenSSL_1_0_1u"}')[matrix.openssl] }} - name: configure - run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp + run: cmake --preset unit-tests - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests --output-on-failure + run: ctest --preset unit-tests --rerun-failed --output-on-failure - - if: github.event_name == 'push' && always() + - if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && always() uses: ./.github/actions/badge with: category: openssl - label: ${{ matrix.openssl.name }} + label: ${{ matrix.openssl }} openssl-no-deprecated: runs-on: ubuntu-latest @@ -47,20 +60,20 @@ jobs: - uses: ./.github/actions/install/gtest - uses: ./.github/actions/install/openssl with: - version: "openssl-3.0.5" + version: "openssl-3.3.0" - name: configure - run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" + run: cmake --preset unit-tests -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1" - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure libressl: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - libressl: ["3.5.3", "3.4.3", "3.3.6"] + libressl: ["3.9.1", "3.8.2", "3.7.3"] name: LibreSSL ${{ matrix.libressl }} steps: - uses: actions/checkout@v4 @@ -74,7 +87,7 @@ jobs: run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=LibreSSL - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure - if: github.event_name == 'push' && always() uses: ./.github/actions/badge @@ -85,12 +98,12 @@ jobs: wolfssl: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: wolfssl: - - { ref: "v5.1.1-stable", name: "5.1.1"} - - { ref: "v5.2.0-stable", name: "5.2.0" } - - { ref: "v5.3.0-stable", name: "5.3.0"} - { ref: "v5.7.0-stable", name: "5.7.0"} + - { ref: "v5.6.6-stable", name: "5.6.6"} + - { ref: "v5.5.4-stable", name: "5.5.4" } name: wolfSSL ${{ matrix.wolfssl.name }} steps: - uses: actions/checkout@v4 @@ -104,7 +117,7 @@ jobs: run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=wolfSSL - run: cmake --build --preset unit-tests - name: test - run: ctest --preset unit-tests + run: ctest --preset unit-tests --rerun-failed --output-on-failure - if: github.event_name == 'push' && always() uses: ./.github/actions/badge diff --git a/docs/ssl.md b/docs/ssl.md index f24e6485..a942cf76 100644 --- a/docs/ssl.md +++ b/docs/ssl.md @@ -18,24 +18,26 @@ These are the version which are currently being tested: | OpenSSL | LibreSSL | wolfSSL | | ----------------- | -------------- | -------------- | -| ![1.0.2u][o1.0.2] | ![3.3.6][l3.3] | ![5.1.1][w5.1] | -| ![1.1.0i][o1.1.0] | ![3.4.3][l3.4] | ![5.2.0][w5.2] | -| ![1.1.1q][o1.1.1] | ![3.5.3][l3.5] | ![5.3.0][w5.3] | -| ![3.0.5][o3.0] | | | +| ![1.0.2u][o1.0.2] | ![3.6.2][l3.6] | ![5.4.0][w5.4] | +| ![1.1.0i][o1.1.0] | ![3.7.2][l3.7] | ![5.5.4][w5.5] | +| ![1.1.1w][o1.1.1] | ![3.8.2][l3.8] | ![5.6.6][w5.6] | +| ![3.2.0][o3.2] | | | + > [!NOTE] > A complete list of versions tested in the past can be found [here](https://github.com/Thalhammer/jwt-cpp/tree/badges). [o1.0.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.0.2u/shields.json [o1.1.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.0i/shields.json -[o1.1.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.1q/shields.json -[o3.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.0.5/shields.json -[l3.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.3.6/shields.json -[l3.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.4.3/shields.json -[l3.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.5.3/shields.json -[w5.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.1.1/shields.json -[w5.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.2.0/shields.json -[w5.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.3.0/shields.json +[o1.1.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/1.1.1w/shields.json +[o3.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.2.0/shields.json +[l3.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.6.2/shields.json +[l3.7]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.7.2/shields.json +[l3.8]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.8.2/shields.json +[w5.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.6.6/shields.json +[w5.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.5.4/shields.json +[w5.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.4.0/shields.json + ## Notes