-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: test folder structure * add integration test for MT SampleServer
- Loading branch information
1 parent
7afa11e
commit ce38342
Showing
32 changed files
with
2,598 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,155 +1,166 @@ | ||
--- | ||
name: Build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [main, development] | ||
merge_group: | ||
|
||
jobs: | ||
build-linux: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
build_type: [Debug, Release] | ||
arch: ["386", "amd64"] | ||
runs-on: ${{matrix.os}} | ||
env: | ||
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/install | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
path: UmatiDashboardOpcUaClient | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Build UmatiDashboardOpcUaClient with dependencies | ||
# yamllint disable rule:line-length | ||
run: | | ||
#! /bin/bash | ||
LIBCPP_VERSION="$(dpkg -s libstdc++6 | grep Version | awk '{match($0,"[0-9]+.[0-9].[0-9]",a)}END{print a[0]}')" # yamllint disable-line rule:line-length | ||
mkdir -p build | ||
cd build || exit | ||
#shellcheck disable=SC2296 | ||
cmake ../UmatiDashboardOpcUaClient/.github/ -DCMAKE_INSTALL_PREFIX:PATH="${{ env.CMAKE_INSTALL_PREFIX }}" \ | ||
-DCMAKE_BUILD_TYPE="${{matrix.build_type}}" -DPAHO_WITH_SSL=1 -DBUILD_DEB_PACKAGE:BOOL=1 -DDEB_PACKAGE_LIBCPP_VERSION="$LIBCPP_VERSION" | ||
cmake --build . -j | ||
cd Dashboard-Client-build | ||
make package | ||
# yamllint enable rule:line-length | ||
- name: Run Tests | ||
run: | | ||
#! /bin/bash | ||
cd build/Dashboard-Client-build || exit | ||
ctest -V -C "${{matrix.build_type}}" | ||
- name: Run integration test cacert_test | ||
run: | | ||
#! /bin/bash | ||
cd UmatiDashboardOpcUaClient/Tests/integration_tests/cacert_test | ||
./genCerts.sh | ||
cp "${{ github.workspace }}/build/Dashboard-Client-build/Tests/TestCaCertificate" . | ||
docker-compose up -d | ||
./evaluateTest.sh | ||
- name: Upload Artefacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: UmatiDashboardOpcUaClient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}} | ||
path: | | ||
${{ env.CMAKE_INSTALL_PREFIX }}/bin | ||
${{ env.CMAKE_INSTALL_PREFIX }}/share/DashboardOpcUaClient | ||
- name: Upload Debian package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dashboardopcuaclient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}}.deb | ||
path: | | ||
${{ env.CMAKE_INSTALL_PREFIX }}/*.deb | ||
build-windows: | ||
strategy: | ||
matrix: | ||
os: [windows-2019, windows-2022] | ||
build_type: [Debug, Release] | ||
arch: ["386", "amd64"] | ||
runs-on: ${{matrix.os}} | ||
env: | ||
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/install | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
path: UmatiDashboardOpcUaClient | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Build UmatiDashboardOpcUaClient with dependencies | ||
shell: pwsh | ||
# yamllint disable rule:line-length | ||
run: | | ||
#shellcheck disable=SC1073,SC1050,SC1141,SC1083,SC1072,SC2296 | ||
$matrixarch = "${{matrix.arch}}" | ||
if($matrixarch -eq "386"){$arch="Win32"} | ||
if($matrixarch -eq "amd64"){$arch="x64"} | ||
mkdir -p build | ||
cd build || exit | ||
cmake ../UmatiDashboardOpcUaClient/.github/ -DCMAKE_INSTALL_PREFIX:PATH=${{ env.CMAKE_INSTALL_PREFIX }} -A "$arch" -DPAHO_WITH_SSL=1 | ||
cmake --build . -j --config ${{matrix.build_type}} | ||
# yamllint enable rule:line-length | ||
- name: Run Tests | ||
shell: pwsh | ||
run: | | ||
cd build/Dashboard-Client-build || exit | ||
ctest -V -C ${{matrix.build_type}} | ||
- name: Download CA Certs | ||
shell: pwsh | ||
run: | | ||
cd ${{ env.CMAKE_INSTALL_PREFIX }} | ||
mkdir -p bin/certs | ||
curl https://curl.se/ca/cacert.pem -o bin/certs/cacert.pem -s | ||
- name: Upload Artefacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: UmatiDashboardOpcUaClient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}} | ||
path: | | ||
${{ env.CMAKE_INSTALL_PREFIX }}/bin | ||
${{ env.CMAKE_INSTALL_PREFIX }}/share/DashboardOpcUaClient | ||
docker: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
# Check if this is not a pull request and GITHUB_TOKEN is set | ||
# As all env variables are strings, you need to compaire against "== 'true'" (not "== true") | ||
IS_NOT_PR: ${{ !github.head_ref && true }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
path: UmatiDashboardOpcUaClient | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2.2.0 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2.9.1 | ||
- name: PrepareReg Names | ||
# yamllint disable rule:line-length | ||
run: | | ||
#! /bin/bash | ||
#shellcheck disable=SC2296 | ||
echo IMAGE_REPOSITORY="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" | ||
echo IMAGE_TAG="$(echo "${{ github.ref }}" | tr '[:upper:]' '[:lower:]' | awk '{sub(/([^\/]*\/){2}/,""); gsub(/\/|_/, "-")}1')" >> "$GITHUB_ENV" | ||
# yamllint enable rule:line-length | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2.2.0 | ||
if: env.IS_NOT_PR == 'true' && ${{ github.actor }} != 'dependabot' | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Docker Release | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
file: "./UmatiDashboardOpcUaClient/Dockerfile" | ||
context: ./UmatiDashboardOpcUaClient | ||
platforms: linux/amd64 | ||
push: ${{env.IS_NOT_PR == 'true'}} | ||
tags: | | ||
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }} | ||
provenance: false | ||
name: Build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [main, development] | ||
merge_group: | ||
|
||
jobs: | ||
build-linux: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
build_type: [Debug, Release] | ||
arch: ["386", "amd64"] | ||
runs-on: ${{matrix.os}} | ||
env: | ||
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/install | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
path: UmatiDashboardOpcUaClient | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Build UmatiDashboardOpcUaClient with dependencies | ||
# yamllint disable rule:line-length | ||
run: | | ||
#! /bin/bash | ||
LIBCPP_VERSION="$(dpkg -s libstdc++6 | grep Version | awk '{match($0,"[0-9]+.[0-9].[0-9]",a)}END{print a[0]}')" # yamllint disable-line rule:line-length | ||
mkdir -p build | ||
cd build || exit | ||
#shellcheck disable=SC2296 | ||
cmake ../UmatiDashboardOpcUaClient/.github/ -DCMAKE_INSTALL_PREFIX:PATH="${{ env.CMAKE_INSTALL_PREFIX }}" \ | ||
-DCMAKE_BUILD_TYPE="${{matrix.build_type}}" -DPAHO_WITH_SSL=1 -DBUILD_DEB_PACKAGE:BOOL=1 -DDEB_PACKAGE_LIBCPP_VERSION="$LIBCPP_VERSION" | ||
cmake --build . -j | ||
cd Dashboard-Client-build | ||
make package | ||
# yamllint enable rule:line-length | ||
- name: Run Tests | ||
run: | | ||
#! /bin/bash | ||
cd build/Dashboard-Client-build || exit | ||
ctest -V -C "${{matrix.build_type}}" | ||
- name: Run integration test cacert_test | ||
run: | | ||
#! /bin/bash | ||
cd UmatiDashboardOpcUaClient/Tests/integration/cacert_test || exit | ||
./genCerts.sh | ||
cp "${{ github.workspace }}/build/Dashboard-Client-build/Tests/unit/TestCaCertificate" . | ||
docker-compose up -d | ||
./evaluateTest.sh | ||
- name: Upload Artefacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: UmatiDashboardOpcUaClient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}} | ||
path: | | ||
${{ env.CMAKE_INSTALL_PREFIX }}/bin | ||
${{ env.CMAKE_INSTALL_PREFIX }}/share/DashboardOpcUaClient | ||
- name: Upload Debian package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dashboardopcuaclient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}}.deb | ||
path: | | ||
${{ env.CMAKE_INSTALL_PREFIX }}/*.deb | ||
build-windows: | ||
strategy: | ||
matrix: | ||
os: [windows-2019, windows-2022] | ||
build_type: [Debug, Release] | ||
arch: ["386", "amd64"] | ||
runs-on: ${{matrix.os}} | ||
env: | ||
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/install | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
path: UmatiDashboardOpcUaClient | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Build UmatiDashboardOpcUaClient with dependencies | ||
shell: pwsh | ||
# yamllint disable rule:line-length | ||
run: | | ||
#shellcheck disable=SC1073,SC1050,SC1141,SC1083,SC1072,SC2296 | ||
$matrixarch = "${{matrix.arch}}" | ||
if($matrixarch -eq "386"){$arch="Win32"} | ||
if($matrixarch -eq "amd64"){$arch="x64"} | ||
mkdir -p build | ||
cd build || exit | ||
cmake ../UmatiDashboardOpcUaClient/.github/ -DCMAKE_INSTALL_PREFIX:PATH=${{ env.CMAKE_INSTALL_PREFIX }} -A "$arch" -DPAHO_WITH_SSL=1 | ||
cmake --build . -j --config ${{matrix.build_type}} | ||
# yamllint enable rule:line-length | ||
- name: Run Tests | ||
shell: pwsh | ||
run: | | ||
cd build/Dashboard-Client-build || exit | ||
ctest -V -C ${{matrix.build_type}} | ||
- name: Download CA Certs | ||
shell: pwsh | ||
run: | | ||
cd ${{ env.CMAKE_INSTALL_PREFIX }} | ||
mkdir -p bin/certs | ||
curl https://curl.se/ca/cacert.pem -o bin/certs/cacert.pem -s | ||
- name: Upload Artefacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: UmatiDashboardOpcUaClient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}} | ||
path: | | ||
${{ env.CMAKE_INSTALL_PREFIX }}/bin | ||
${{ env.CMAKE_INSTALL_PREFIX }}/share/DashboardOpcUaClient | ||
docker: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
# Check if this is not a pull request and GITHUB_TOKEN is set | ||
# As all env variables are strings, you need to compaire against "== 'true'" (not "== true") | ||
IS_NOT_PR: ${{ !github.head_ref && true }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3.5.3 | ||
with: | ||
path: UmatiDashboardOpcUaClient | ||
submodules: recursive | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2.2.0 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2.9.1 | ||
- name: PrepareReg Names | ||
# yamllint disable rule:line-length | ||
run: | | ||
#! /bin/bash | ||
#shellcheck disable=SC2296 | ||
echo IMAGE_REPOSITORY="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV" | ||
echo IMAGE_TAG="$(echo "${{ github.ref }}" | tr '[:upper:]' '[:lower:]' | awk '{sub(/([^\/]*\/){2}/,""); gsub(/\/|_/, "-")}1')" >> "$GITHUB_ENV" | ||
# yamllint enable rule:line-length | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2.2.0 | ||
if: env.IS_NOT_PR == 'true' && ${{ github.actor }} != 'dependabot' | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Docker Release | ||
uses: docker/build-push-action@v4.1.1 | ||
with: | ||
file: "./UmatiDashboardOpcUaClient/Dockerfile" | ||
context: ./UmatiDashboardOpcUaClient | ||
platforms: linux/amd64 | ||
push: ${{env.IS_NOT_PR == 'true'}} | ||
tags: | | ||
ghcr.io/${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_TAG }} | ||
provenance: false | ||
- name: Run integration test mqtt | ||
if: ${{env.IS_NOT_PR == 'true'}} | ||
run : | | ||
#! /bin/bash | ||
python -m pip install --upgrade pip | ||
cd ./UmatiDashboardOpcUaClient/Tests/integration/mqtt_test || exit | ||
pip install -r requirements.txt | ||
docker compose up -d | ||
./waitForContainer.sh | ||
python -m unittest discover test_mqtt_sampleserver | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.