chore(deps): update deps/json digest to 6be4e85 #8215
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
--- | |
name: Build | |
on: | |
push: | |
pull_request: | |
branches: [main, development] | |
merge_group: | |
permissions: read-all | |
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@v4.2.2 | |
with: | |
path: UmatiDashboardOpcUaClient | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Downgrade libstdc++6 on ubuntu-22.04 | |
# yamllint disable rule:line-length | |
if: ${{matrix.os == 'ubuntu-22.04'}} | |
run: | | |
#! /bin/bash | |
dpkg -l libstdc++6 | |
sudo apt install libstdc++6=12.3.0-1ubuntu1~22.04 -y --allow-downgrades | |
- name: Build UmatiDashboardOpcUaClient with dependencies | |
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 | |
echo "libstdc++6 version=$LIBCPP_VERSION" | |
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 | |
# yamllint disable rule:line-length | |
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 | |
# yamllint enable rule:line-length | |
- name: Upload Artefacts | |
uses: actions/upload-artifact@v4 | |
with: | |
# yamllint disable rule:line-length | |
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@v4 | |
with: | |
name: dashboardopcuaclient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}}.deb | |
path: | | |
${{ env.CMAKE_INSTALL_PREFIX }}/*.deb | |
# yamllint enable rule:line-length | |
build-windows: | |
strategy: | |
max-parallel: 4 | |
matrix: | |
os: [windows-2019, windows-2022] | |
build_type: [Debug, Release] | |
arch: ["386", "amd64"] | |
runs-on: ${{matrix.os}} | |
continue-on-error: true | |
env: | |
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/install | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4.2.2 | |
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@v4 | |
with: | |
# yamllint disable rule:line-length | |
name: UmatiDashboardOpcUaClient-${{matrix.build_type}}-${{matrix.os}}-${{matrix.arch}} | |
path: | | |
${{ env.CMAKE_INSTALL_PREFIX }}/bin | |
${{ env.CMAKE_INSTALL_PREFIX }}/share/DashboardOpcUaClient | |
# yamllint enable rule:line-length | |
docker: | |
permissions: | |
packages: write | |
runs-on: ubuntu-24.04 | |
env: | |
# Check if this is not a pull request and GITHUB_TOKEN is set | |
# As all env variables are strings, you need to compare | |
# against "== 'true'" (not "== true") | |
IS_NOT_PR: ${{ !github.head_ref && true }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4.2.2 | |
with: | |
path: UmatiDashboardOpcUaClient | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3.2.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3.8.0 | |
- 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@v3.3.0 | |
if: env.IS_NOT_PR == 'true' | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker Release | |
uses: docker/build-push-action@v6.10.0 | |
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 | |
release: | |
permissions: | |
contents: write | |
runs-on: ubuntu-24.04 | |
needs: [build-linux, build-windows] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v7 | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
workflow: build.yml | |
workflow_conclusion: success | |
repo: ${{ github.repository }} | |
commit: ${{github.event.pull_request.head.sha}} | |
if_no_artifact_found: fail | |
skip_unpack: true | |
- name: Checksum | |
run: | | |
#! /bin/bash | |
sha256sum ./*.zip > SHA256-checksums | |
- name: Display structure of downloaded files | |
run: ls -R | |
- name: Release | |
uses: softprops/action-gh-release@v2.2.0 | |
with: | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
./*.zip | |
SHA256-checksums |