|
| 1 | +name: Build and Test simple device module with latest openDAQ release |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - jira/* |
| 8 | + |
| 9 | +env: |
| 10 | + GH_TOKEN: ${{ github.token }} |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-and-test: |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, windows-latest] |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout simple device module repo |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Determine openDAQ framework package |
| 25 | + id: opendaq-framework |
| 26 | + uses: ./.github/actions/framework-latest-release |
| 27 | + |
| 28 | + - name: Download openDAQ framework |
| 29 | + uses: ./.github/actions/framework-download |
| 30 | + with: |
| 31 | + src-opendaq-framework-dev: ${{ steps.opendaq-framework.outputs.uri }} |
| 32 | + dst-opendaq-framework-dev: ${{ runner.temp }}/${{ steps.opendaq-framework.outputs.artefact }} |
| 33 | + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 34 | + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 35 | + aws_region: ${{ secrets.AWS_REGION }} |
| 36 | + |
| 37 | + - name: Install openDAQ framework package |
| 38 | + uses: ./.github/actions/framework-install |
| 39 | + with: |
| 40 | + opendaq-framework-package-filename: ${{ steps.opendaq-framework.outputs.artefact }} |
| 41 | + |
| 42 | + # - name: Archive installed openDAQ |
| 43 | + # if: runner.os == 'Windows' |
| 44 | + # shell: pwsh |
| 45 | + # run: | |
| 46 | + # Compress-Archive -Path "C:/Program Files/openDAQ" -DestinationPath "$env:RUNNER_TEMP/opendaq.zip" |
| 47 | + |
| 48 | + # - name: Upload openDAQ artifact |
| 49 | + # if: runner.os == 'Windows' |
| 50 | + # uses: actions/upload-artifact@v4 |
| 51 | + # with: |
| 52 | + # name: opendaq-install |
| 53 | + # path: ${{ runner.temp }}/opendaq.zip |
| 54 | + |
| 55 | + # - name: Install Windows dependencies |
| 56 | + # id: windows-dependencies-install |
| 57 | + # if: runner.os == 'Windows' |
| 58 | + # uses: ./.github/actions/dependencies-install |
| 59 | + |
| 60 | + - name: Configure simple device module with CMake Windows |
| 61 | + if: runner.os == 'Windows' |
| 62 | + # run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ steps.windows-dependencies-install.outputs.vcpkg-toolchain-file }} |
| 63 | + run: cmake -B build/output -S . -G "Visual Studio 17 2022" -DOPENDAQ_ENABLE_TESTS=ON -DOPENDAQ_MSVC_SINGLE_PROCESS_BUILD=ON -DDAQMODULES_PARQUET_RECORDER_MODULE=ON -DCMAKE_BUILD_TYPE=Release |
| 64 | + |
| 65 | + - name: Build simple device module with CMake Windows |
| 66 | + if: runner.os == 'Windows' |
| 67 | + run: cmake --build build/output --config Release |
| 68 | + |
| 69 | + - name: Run simple device module tests via CTest with GTest report Windows |
| 70 | + if: runner.os == 'Windows' |
| 71 | + run: | |
| 72 | + New-Item -ItemType Directory -Force -Path build/reports | Out-Null |
| 73 | + $env:GTEST_OUTPUT = "xml:$PWD/build/reports/gtest-report.xml" |
| 74 | + ctest --test-dir build/output --output-on-failure -C Release -V |
| 75 | +
|
| 76 | + - name: Configure simple device module with CMake |
| 77 | + if: runner.os != 'Windows' |
| 78 | + run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release |
| 79 | + |
| 80 | + - name: Build simple device module with CMake |
| 81 | + if: runner.os != 'Windows' |
| 82 | + run: cmake --build build/output --target all |
| 83 | + |
| 84 | + - name: Run simple device module tests via CTest with GTest report |
| 85 | + if: runner.os != 'Windows' |
| 86 | + run: | |
| 87 | + mkdir -p build/reports |
| 88 | + GTEST_OUTPUT=xml:$(pwd)/build/reports/gtest-report.xml ctest --test-dir build/output --output-on-failure -V |
0 commit comments