|
| 1 | +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. |
| 2 | +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml |
| 3 | +name: Open Watcom (CMake on multiple platforms) |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + common: |
| 14 | + #- cmake: '--debug-output --trace -Wdev -B build -G "Watcom WMake" -DCMAKE_VERBOSE_MAKEFILE=TRUE' |
| 15 | + - cmake: '-B build -G "Watcom WMake" -DCMAKE_VERBOSE_MAKEFILE=TRUE' |
| 16 | + config: |
| 17 | + - name: 'Release' |
| 18 | + id: 'Release' |
| 19 | + cmake: '-DCMAKE_BUILD_TYPE=Release' |
| 20 | + owimage: |
| 21 | + - name: '1.9' |
| 22 | + ver: '1.9' |
| 23 | + id: '19' |
| 24 | + - name: '2.0' |
| 25 | + ver: '2.0' |
| 26 | + id: '20' |
| 27 | + os: |
| 28 | + - name: 'Windows on Windows' |
| 29 | + host: 'Windows' |
| 30 | + id: 'windows' |
| 31 | + image: 'windows-latest' |
| 32 | + cmake: '-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86 -DWOLFSSL_ASM=no' |
| 33 | + - name: 'Linux on Linux' |
| 34 | + host: 'Linux' |
| 35 | + id: 'linux' |
| 36 | + image: 'ubuntu-latest' |
| 37 | + cmake: '-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=x86 -DWOLFSSL_ASM=no' |
| 38 | + - name: 'Linux on Windows' |
| 39 | + host: 'Windows' |
| 40 | + id: 'linux' |
| 41 | + image: 'windows-latest' |
| 42 | + cmake: '-DCMAKE_SYSTEM_NAME=Linux -DWOLFSSL_ASM=no' |
| 43 | + - name: 'OS/2 on Windows' |
| 44 | + host: 'Windows' |
| 45 | + id: 'os2' |
| 46 | + image: 'windows-latest' |
| 47 | + cmake: '-DCMAKE_SYSTEM_NAME=OS2 -DWOLFSSL_ASM=no' |
| 48 | + #cmake: '-DCMAKE_SYSTEM_NAME=OS2 -DWOLFSSL_ASM=no -DWOLFSSL_EXAMPLES=no -DWOLFSSL_CRYPT_TESTS=no' |
| 49 | + thread: |
| 50 | + - name: 'mt' |
| 51 | + id: 'mt' |
| 52 | + cmake: '' |
| 53 | + owcmake: '-DCMAKE_POLICY_DEFAULT_CMP0136=NEW -DCMAKE_WATCOM_RUNTIME_LIBRARY=MultiThreaded' |
| 54 | + - name: 'st' |
| 55 | + id: 'st' |
| 56 | + cmake: '-DWOLFSSL_SINGLE_THREADED=yes' |
| 57 | + owcmake: '-DCMAKE_POLICY_DEFAULT_CMP0136=NEW -DCMAKE_WATCOM_RUNTIME_LIBRARY=SingleThreaded' |
| 58 | + library: |
| 59 | + - name: 'DLL' |
| 60 | + id: 'dll' |
| 61 | + cmake: '' |
| 62 | + owcmake: 'DLL' |
| 63 | + - name: '' |
| 64 | + id: 'static' |
| 65 | + cmake: '-DBUILD_SHARED_LIBS=no' |
| 66 | + owcmake: '' |
| 67 | + openssl: |
| 68 | + - name: '' |
| 69 | + id: '' |
| 70 | + cmake: '' |
| 71 | + - name: 'OpenSSL' |
| 72 | + id: 'ossl' |
| 73 | + cmake: '-DWOLFSSL_OPENSSLALL=yes' |
| 74 | + ip: |
| 75 | + - name: 'IPV4' |
| 76 | + id: 'ip4' |
| 77 | + cmake: '' |
| 78 | + - name: 'IPV6' |
| 79 | + id: 'ip6' |
| 80 | + cmake: '-DWOLFSSL_IPV6=yes' |
| 81 | + exclude: |
| 82 | + - { os: { id: 'linux' }, library: { id: 'dll' } } |
| 83 | + - { os: { id: 'linux' }, thread: { id: 'mt' }, owimage: { ver: '1.9' } } |
| 84 | + runs-on: ${{matrix.os.image}} |
| 85 | + name: ${{matrix.os.name}} OW ${{matrix.owimage.name}} (${{matrix.ip.name}} ${{matrix.thread.name}} ${{matrix.library.name}} ${{matrix.openssl.name}}) |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Install Open Watcom |
| 90 | + uses: open-watcom/setup-watcom@v0 |
| 91 | + with: |
| 92 | + version: ${{matrix.owimage.ver}} |
| 93 | + - name: Create build subdirectory |
| 94 | + run: mkdir build |
| 95 | + - name: Configure CMake |
| 96 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only |
| 97 | + # required if you are using a single-configuration generator such as make. |
| 98 | + run: cmake ${{matrix.common.cmake}} ${{matrix.config.cmake}} ${{matrix.os.cmake}} ${{matrix.ip.cmake}} ${{matrix.thread.cmake}} ${{matrix.library.cmake}} ${{matrix.openssl.cmake}} ${{matrix.thread.owcmake}}${{matrix.library.owcmake}} |
| 99 | + - name: Build |
| 100 | + run: cmake --build build |
| 101 | + - name: Upload build errors |
| 102 | + #if: failure() |
| 103 | + if: always() |
| 104 | + uses: actions/upload-artifact@v4 |
| 105 | + with: |
| 106 | + name: ${{matrix.os.id}}-${{matrix.os.host}}-${{matrix.owimage.ver}}-${{matrix.ip.id}}-${{matrix.thread.id}}-${{matrix.library.id}}-${{matrix.openssl.id}} |
| 107 | + path: | |
| 108 | + build/** |
| 109 | + - name: Tests Windows |
| 110 | + if: matrix.os.host == 'Windows' && matrix.os.id == 'Windows' |
| 111 | + working-directory: build/wolfcrypt/test |
| 112 | + run: | |
| 113 | + copy ${{github.workspace}}\build\wolfssl.dll . |
| 114 | + mkdir certs |
| 115 | + copy ${{github.workspace}}\certs\*.der .\certs\ |
| 116 | + testwolfcrypt |
| 117 | + shell: cmd |
| 118 | + - name: Tests Linux |
| 119 | + if: matrix.os.host == 'Linux' && matrix.os.id == 'Linux' |
| 120 | + working-directory: build/wolfcrypt/test |
| 121 | + run: | |
| 122 | + mkdir certs |
| 123 | + cp ${{github.workspace}}/certs/*.der ./certs/ |
| 124 | + ./testwolfcrypt |
| 125 | + shell: bash |
| 126 | + - name: Benchmark Windows |
| 127 | + if: matrix.os.host == 'Windows' && matrix.os.id == 'Windows' |
| 128 | + working-directory: build/wolfcrypt/benchmark |
| 129 | + run: | |
| 130 | + copy ${{github.workspace}}\build\wolfssl.dll . |
| 131 | + benchmark |
| 132 | + shell: cmd |
| 133 | + - name: Benchmark Linux |
| 134 | + if: matrix.os.host == 'Linux' && matrix.os.id == 'Linux' |
| 135 | + working-directory: build/wolfcrypt/benchmark |
| 136 | + run: | |
| 137 | + ./benchmark |
| 138 | + shell: bash |
0 commit comments