Linty #17085
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: UDMI test suite | |
on: | |
push: | |
workflow_dispatch: | |
pull_request: | |
schedule: | |
- cron: '0 13 * * *' | |
concurrency: | |
group: ci-${{ github.repository }} | |
cancel-in-progress: true | |
jobs: | |
unit: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: start and test local servers | |
run: | | |
bin/setup_base | |
bin/clone_model | |
bin/start_pubsub | |
- name: bin/run_tests all_tests | |
run: bin/run_tests all_tests | |
- name: all test output | |
if: ${{ !cancelled() }} | |
run: more out/test_* | |
- name: validator test output | |
if: ${{ !cancelled() }} | |
run: more out/test_validator+bin+build+check | |
- name: pubber test output | |
if: ${{ !cancelled() }} | |
run: more out/test_pubber+bin+build+check | |
- name: udmis test output | |
if: ${{ !cancelled() }} | |
run: more out/test_bin+test_udmis | |
- name: site test output | |
if: ${{ !cancelled() }} | |
run: more out/test_bin+test_sites | |
spelling: | |
name: Docs Spelling Checks | |
runs-on: ubuntu-latest | |
timeout-minutes: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Spelling | |
uses: rojopolis/[email protected] | |
with: | |
config_path: .spellcheck.yml | |
task_name: Markdown | |
udmif: | |
name: UDMIF unit tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20.9.0 | |
- name: Install Angular CLI | |
run: npm install -g @angular/cli | |
- name: web tests | |
run: echo Disabled udmif/web/runTests due to dependency integration problems | |
- name: api tests | |
run: echo Disabled udmif/api/runTests due to dependency integration problems | |
pretest: | |
name: Pre-test Setup | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
timeout-minutes: 5 | |
if: vars.TARGET_PROJECT != '' | |
env: | |
PUSH_REGISTRY: ghcr.io | |
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} | |
UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA | |
UDMI_UPDATE_UDMIS: ${{ vars.UDMI_UPDATE_UDMIS }} | |
IMAGE_NAME: ${{ github.repository }} | |
GITHUB_REF: ${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: sanity check | |
run: | | |
[[ -n $UDMI_ALT_REGISTRY ]] | |
[[ -n $TARGET_PROJECT ]] | |
- name: Log in to the github registry | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.PUSH_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup udmis container build | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
revhash=$(git log -n 1 --pretty=format:"%h" udmis) | |
IMAGE_TAG=U${revhash:0:9} | |
PUSH_REPO=$PUSH_REGISTRY/${{ github.repository }} | |
PUSH_TAG=$PUSH_REPO:udmis-$IMAGE_TAG | |
echo PUSH_TAG=$PUSH_TAG >> $GITHUB_ENV | |
bin/container udmis prep --no-check $PUSH_TAG | |
echo Pushing built container as $PUSH_TAG | tee -a $GITHUB_STEP_SUMMARY | |
- name: Build and push docker image | |
if: ${{ github.event_name == 'push' }} | |
uses: docker/build-push-action@v5 | |
with: | |
file: udmis/Dockerfile.udmis | |
context: udmis | |
push: true | |
tags: ${{ env.PUSH_TAG }} | |
- name: Update udmis deployment | |
if: ${{ env.UDMI_UPDATE_UDMIS != '' }} | |
run: | | |
bin/clone_model | |
bin/update_udmis sites/udmi_site_model/ $TARGET_PROJECT $PUSH_TAG | |
sequencer: | |
name: Sequencer Tests | |
runs-on: ubuntu-latest | |
needs: pretest | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
if: vars.TARGET_PROJECT != '' | |
env: | |
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} | |
UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA | |
UDMI_REGISTRY_SUFFIX: _${{ matrix.shard }} | |
MATRIX_SHARD_COUNT: 10 | |
MATRIX_SHARD_INDEX: ${{ matrix.shard }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: base setup | |
run: bin/run_tests install_dependencies | |
- name: registrar clean | |
run: bin/test_regclean $TARGET_PROJECT | |
- name: sequence tests clean | |
if: ${{ !cancelled() }} | |
run: bin/test_sequencer clean nocheck $TARGET_PROJECT | |
- name: sequence tests alpha | |
if: ${{ !cancelled() }} | |
run: bin/test_sequencer alpha nocheck $TARGET_PROJECT | |
- name: sequence test post-process | |
if: ${{ !cancelled() }} | |
run: egrep ' test .* after .*s ' out/sequencer.log | tee out/timing_sequencer.out | |
- name: itemized sequencer tests | |
if: ${{ !cancelled() }} | |
run: bin/test_itemized $TARGET_PROJECT | |
- name: output files | |
if: ${{ !cancelled() }} | |
run: more out/*.out* | cat | |
- name: pubber logs | |
if: ${{ !cancelled() }} | |
run: more out/pubber.log* pubber/out/*.json | cat | |
- name: itemized test post-process | |
if: ${{ !cancelled() }} | |
run: egrep ' test .* after .*s ' out/sequencer.log-* | tee out/timing_itemized.out | |
- name: support bundle | |
if: ${{ !cancelled() }} | |
run: | | |
bin/support ${{ github.repository_owner }}_${{ github.job }}_ | |
tar -tzvf *udmi-support*.tgz | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
if-no-files-found: error | |
name: udmi-support_${{ github.run_id }}-${{ matrix.shard }} | |
path: '*_udmi-support_*.tgz' | |
baseline: | |
name: Baseline Tests | |
runs-on: ubuntu-latest | |
needs: pretest | |
timeout-minutes: 10 | |
if: vars.TARGET_PROJECT != '' | |
env: | |
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} | |
UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: base setup | |
run: bin/run_tests install_dependencies | |
- name: registrar clean | |
run: bin/test_regclean solo $TARGET_PROJECT | |
- name: telemetry validator | |
if: ${{ !cancelled() }} | |
run: bin/test_validator $TARGET_PROJECT | |
- name: validator result | |
if: ${{ !cancelled() }} | |
run: cat /tmp/validator.out || true | |
- name: message captures | |
if: ${{ !cancelled() }} | |
run: | | |
cd sites/udmi_site_model/out | |
find . -type f | sort | xargs ls -l | |
find . -type f | sort | xargs more | cat | |
- name: nostate sequences | |
if: ${{ !cancelled() }} | |
run: bin/test_sequencer nostate full $TARGET_PROJECT | |
- name: support bundle | |
if: ${{ !cancelled() }} | |
run: UDMI_REGISTRY_SUFFIX=_b bin/support ${{ github.repository_owner }}_${{ github.job }}_ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
if-no-files-found: error | |
name: udmi-support_${{ github.run_id }}-b | |
path: '*_udmi-support_*.tgz' | |
runlocal: | |
name: UDMIS Local Setup | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: base setup | |
run: bin/run_tests install_dependencies | |
- name: bin/start_etcd | |
run: bin/start_etcd | |
- name: bin/test_etcd | |
run: bin/test_etcd | |
- name: bin/test_mosquitto | |
run: bin/test_mosquitto | |
- name: bin/test_udmis | |
run: bin/test_udmis | |
- name: mosquitto debug | |
if: ${{ !cancelled() }} | |
run: sudo cat /etc/mosquitto/dynamic_security.json | |
- name: support bundle | |
if: ${{ !cancelled() }} | |
run: bin/support ${{ github.repository_owner }}_${{ github.job }}_ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
if-no-files-found: error | |
name: udmi-support_${{ github.run_id }}-l | |
path: '*_udmi-support_*.tgz' | |
redirect: | |
name: Endpoint Redirection | |
runs-on: ubuntu-latest | |
needs: [ pretest, baseline ] | |
timeout-minutes: 10 | |
if: vars.TARGET_PROJECT != '' | |
env: | |
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} | |
UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA | |
MQTT_PROXY_HOST: ${{ vars.MQTT_PROXY_HOST }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: base setup | |
run: bin/run_tests install_dependencies | |
- name: bin/test_proxy | |
if: ${{ env.MQTT_PROXY_HOST != '' }} | |
run: bin/test_proxy $TARGET_PROJECT $MQTT_PROXY_HOST | |
- name: bin/test_redirect | |
run: bin/test_redirect $TARGET_PROJECT | |
- name: pubber.log | |
if: ${{ !cancelled() }} | |
run: more out/pubber.log* | cat | |
- name: support bundle | |
if: ${{ !cancelled() }} | |
run: UDMI_REGISTRY_SUFFIX=_r bin/support ${{ github.repository_owner }}_${{ github.job }}_ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
if-no-files-found: error | |
name: udmi-support_${{ github.run_id }}-r | |
path: '*_udmi-support_*.tgz' | |
posttest: | |
name: Post-test Summarization | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
needs: [ baseline, sequencer, redirect, runlocal ] | |
if: ${{ !cancelled() && vars.TARGET_PROJECT != '' }} | |
env: | |
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }} | |
UDMI_ALT_REGISTRY: ZZ-REDIRECT-NA | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Base setup | |
run: bin/setup_base | |
- name: Download all sharded support packages | |
uses: actions/download-artifact@v4 | |
with: | |
path: udmi-support_${{ github.run_id }} | |
pattern: udmi-support_${{ github.run_id }}-* | |
merge-multiple: true | |
- name: Upload merged support package | |
uses: actions/upload-artifact@v4 | |
with: | |
if-no-files-found: error | |
name: udmi-support_${{ github.run_id }} | |
path: 'udmi-support_${{ github.run_id }}/*_udmi-support_*.tgz' | |
- name: Processing support package | |
run: bin/support_process udmi-support_* | |
- name: Test run index | |
run: | | |
ls -d sites/udmi_site_model*/out*/devices/AHU-1/tests/* | |
find out* -name 'schema*.out*' -size +0 | xargs more | cat | |
- name: Sequencer validation | |
if: ${{ !cancelled() }} | |
run: bin/test_sequcheck | |
- name: Itemized validation | |
if: ${{ !cancelled() }} | |
run: bin/test_itemcheck |