|
| 1 | +name: cmake-windows-release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "master", "devel", |
| 6 | + "citest", |
| 7 | + "citest-cmake", |
| 8 | + "citest-cmake-windows" ] |
| 9 | + tags: |
| 10 | + - '**' |
| 11 | + pull_request: |
| 12 | + branches: [ "master", "devel" ] |
| 13 | + |
| 14 | +jobs: |
| 15 | + windows_build: |
| 16 | + runs-on: windows-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: install prereq. |
| 20 | + run: | |
| 21 | + choco install ninja cmake gzip |
| 22 | + ninja --version |
| 23 | + cmake --version |
| 24 | + gzip --version |
| 25 | + - name: cmake_shared_configure |
| 26 | + shell: bash |
| 27 | +# run: util/cmake_shared_configure |
| 28 | + run: util/cmake_shared_configure --config x64-Release-Shared |
| 29 | + - name: cmake_shared_build |
| 30 | + shell: bash |
| 31 | + run: util/cmake_shared_build |
| 32 | + - name: copy binaries to orig. dirs |
| 33 | + shell: bash |
| 34 | + run: | |
| 35 | + cp -v build/shared/tests/regr/Release/*.exe build/shared/tests/regr/ |
| 36 | + cp -v build/shared/tests/unit/Release/*.exe build/shared/tests/unit/ |
| 37 | + cp -v build/shared/examples/Release/*.exe build/shared/examples/ |
| 38 | + - name: copy dll to dirs with test exe |
| 39 | + shell: bash |
| 40 | + run: | |
| 41 | + cp -v build/shared/src/Release/*.dll build/shared/tests/regr/ |
| 42 | + cp -v build/shared/src/Release/*.dll build/shared/tests/unit/ |
| 43 | + cp -v build/shared/src/Release/*.dll build/shared/examples/ |
| 44 | + - name: cmake_shared_test |
| 45 | + shell: bash |
| 46 | + run: util/cmake_shared_test |
| 47 | +# - name: cmake_shared_install |
| 48 | +# shell: bash |
| 49 | +# run: util/cmake_shared_install |
| 50 | + - name: check build files |
| 51 | + shell: bash |
| 52 | + run: | |
| 53 | + pwd |
| 54 | + find |
| 55 | + - name: prepare artifacts |
| 56 | + shell: bash |
| 57 | + run: | |
| 58 | + mkdir -p artifacts/bin |
| 59 | + cp -v build/shared/src/Release/*.dll \ |
| 60 | + build/shared/examples/Release/*.exe \ |
| 61 | + artifacts/bin |
| 62 | + mkdir artifacts/include |
| 63 | + cp -vR src/*.h artifacts/include |
| 64 | + cp -vR README.md \ |
| 65 | + COPYING* \ |
| 66 | + AUTHORS \ |
| 67 | + ChangeLog \ |
| 68 | + doc \ |
| 69 | + artifacts/ |
| 70 | + - name: set env |
| 71 | + shell: bash |
| 72 | + run: echo "ADFLIB_TAG=${GITHUB_REF#refs/*/}" | tr / _ >> $GITHUB_ENV |
| 73 | + - name: Test |
| 74 | + shell: bash |
| 75 | + run: | |
| 76 | + echo $ADFLIB_TAG |
| 77 | + echo ${{ env.ADFLIB_TAG }} |
| 78 | + - uses: actions/upload-artifact@v4 |
| 79 | + with: |
| 80 | +# name: adflib-${{ env.ADFLIB_TAG }}-windows |
| 81 | + name: adflib-windows |
| 82 | + path: | |
| 83 | + artifacts/ |
| 84 | + - name: archive tests/examples |
| 85 | + shell: bash |
| 86 | + run: | |
| 87 | + mkdir -v artifact-tests |
| 88 | + tar cvzf artifact-tests/tests_examples.tgz \ |
| 89 | + tests/config* \ |
| 90 | + tests/examples/ \ |
| 91 | + tests/examples2/ \ |
| 92 | + tests/data |
| 93 | + - uses: actions/upload-artifact@v4 |
| 94 | + with: |
| 95 | + name: adflib-windows-tests-examples |
| 96 | + path: | |
| 97 | + artifact-tests |
| 98 | +
|
| 99 | + windows_test: |
| 100 | + runs-on: windows-latest |
| 101 | + needs: windows_build |
| 102 | + steps: |
| 103 | + - uses: actions/download-artifact@v4 |
| 104 | + with: |
| 105 | +# name: adflib-${{ env.ADFLIB_TAG }}-windows |
| 106 | + name: adflib-windows |
| 107 | + path: . |
| 108 | + - name: install prereq. |
| 109 | + run: | |
| 110 | + choco install gzip |
| 111 | + gzip --version |
| 112 | + - name: list files extracted from the artifact |
| 113 | + shell: bash |
| 114 | + run: find . |
| 115 | + - uses: actions/download-artifact@v4 |
| 116 | + with: |
| 117 | + name: adflib-windows-tests-examples |
| 118 | + path: . |
| 119 | + - name: extract tests/examples |
| 120 | + shell: bash |
| 121 | + run: tar xvzf tests_examples.tgz |
| 122 | + - name: test command-line utils |
| 123 | + shell: bash |
| 124 | +# these test does not work - output on windows is different (EOL is CR+LF) |
| 125 | +# run: ./examples/tests/test_all_examples.sh bin |
| 126 | +# for just check if they execute at all instead |
| 127 | + run: | |
| 128 | + tests/examples/test_examples_basic.sh bin/ |
| 129 | + tests/examples/test_all_examples.sh bin |
| 130 | + - name: test installed command-line utils (2) |
| 131 | + shell: bash |
| 132 | + run: | |
| 133 | + cat tests/config.sh.in_cmake | \ |
| 134 | + sed -e 's@\${PROJECT_BINARY_DIR}@'"."'@' \ |
| 135 | + -e 's@\${PROJECT_SOURCE_DIR}@'"."'@' \ |
| 136 | + > tests/config.sh |
| 137 | + cat tests/config.sh |
| 138 | + ./tests/examples2/run_all_tests.sh bin |
| 139 | + - name: store logs from failed tests |
| 140 | + if: failure() |
| 141 | + uses: actions/upload-artifact@v4 |
| 142 | + with: |
| 143 | + name: cmake_windows_logs_failed_tests |
| 144 | + path: | |
| 145 | + cmake/shared/Testing/ |
0 commit comments