Skip to content

Add namespaces for registries, topics, and k8s installs #8452

Add namespaces for registries, topics, and k8s installs

Add namespaces for registries, topics, and k8s installs #8452

Workflow file for this run

name: UDMI test suite
on:
push:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 13 * * *'
concurrency:
group: ci-${{ github.repository }}
cancel-in-progress: true
jobs:
udmis:
name: UDMIS Tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 10
env:
PUSH_REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- name: bin/run_tests install_dependencies
run: bin/run_tests install_dependencies
- name: bin/start_pubsub
run: bin/start_pubsub
- name: bin/test_mosquitto
run: bin/test_mosquitto
- name: bin/run_tests udmis_tests
run: bin/run_tests udmis_tests
- name: test output
if: ${{ always() }}
run: more out/test_* | cat
- name: Log in to the github registry
uses: docker/login-action@v2
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 rev-parse $GITHUB_REF)
IMAGE_TAG=g${revhash:0:9}
PUSH_REPO=$PUSH_REGISTRY/${{ github.repository }}
PUSH_TAG=$PUSH_REPO:$IMAGE_TAG
echo PUSH_TAG=$PUSH_TAG >> $GITHUB_ENV
udmis/bin/container prep --no-check ${PUSH_REPO%/*}
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@v4
with:
file: udmis/Dockerfile.udmis
context: udmis
push: true
tags: ${{ env.PUSH_TAG }}
unit:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Checkout source
uses: actions/checkout@v3
- name: bin/run_tests all_tests
run: bin/run_tests all_tests
- name: all test output
if: ${{ always() }}
run: more out/test_* | cat
spelling:
name: Docs Spelling Checks
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v3
- name: Check Spelling
uses: rojopolis/spellcheck-github-actions@0.23.0
with:
config_path: .spellcheck.yml
task_name: Markdown
udmif:
name: UDMIF unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.16.0
- name: Install Angular CLI
run: npm install -g @angular/cli
- name: web tests
run: udmif/web/runTests
- name: api tests
run: udmif/api/runTests
sequencer:
name: Sequencer Suite
runs-on: ubuntu-latest
timeout-minutes: 35
if: vars.TARGET_PROJECT != '' && vars.UDMI_REGISTRY_SUFFIX != ''
env:
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }}
UDMI_REGISTRY_SUFFIX: ${{ vars.UDMI_REGISTRY_SUFFIX }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
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
run: bin/test_sequencer clean $TARGET_PROJECT
- name: sequence tests alpha
run: bin/test_sequencer alpha $TARGET_PROJECT
- name: sequence test timing
if: ${{ always() }}
run: fgrep ' ending test ' out/sequencer.log
- name: generated files
if: ${{ always() }}
run: more out/sequencer.out out/generated.md || true
- name: sequencer end state
if: ${{ always() }}
run: cat sites/udmi_site_model/out/sequencer_AHU-1.json || true
- name: schema validation output
if: ${{ always() }}
run: |
echo ============ out/schemas.out
cat out/schemas.out || true
echo ============ find RESULT.log
find sites/udmi_site_model/out/devices/ -name RESULT.log | xargs fgrep -i schema
- name: sequencer markdown report generator
if: ${{ always() }}
run: |
SAMPLE_TEST_ROW="| system | system_last_update | stable | pass | Sequence complete |"
echo Checking for entry in generated results.md
grep "$SAMPLE_TEST_ROW" sites/udmi_site_model/out/devices/AHU-1/results.md
- name: pubber logs
if: ${{ always() }}
run: more out/pubber.out* pubber/out/*/*.json || true
- name: output logs
if: ${{ always() }}
run: cd sites/udmi_site_model/out && more `find . -type f` || true
- name: support bundle
if: ${{ always() }}
run: |
bin/support
mv /tmp/udmi-support_*.tgz ${{ github.repository_owner }}_${{ github.job }}_$(cd /tmp; ls udmi-support_*.tgz)
echo Renamed support file to `ls *_udmi-support_*.tgz`
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: udmi-support_${{ github.run_id }}
path: '*_udmi-support_*.tgz'
sequencer_dep:
name: Sequencer Suite
runs-on: ubuntu-latest
timeout-minutes: 35
needs: redirect
if: vars.TARGET_PROJECT != '' && vars.UDMI_REGISTRY_SUFFIX == ''
env:
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
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
run: bin/test_sequencer clean $TARGET_PROJECT
- name: sequence tests alpha
run: bin/test_sequencer alpha $TARGET_PROJECT
- name: sequence test timing
if: ${{ always() }}
run: fgrep ' ending test ' out/sequencer.log
- name: generated files
if: ${{ always() }}
run: more out/sequencer.out out/generated.md || true
- name: sequencer end state
if: ${{ always() }}
run: cat sites/udmi_site_model/out/sequencer_AHU-1.json || true
- name: schema validation output
if: ${{ always() }}
run: |
echo ============ out/schemas.out
cat out/schemas.out || true
echo ============ find RESULT.log
find sites/udmi_site_model/out/devices/ -name RESULT.log | xargs fgrep -i schema
- name: pubber logs
if: ${{ always() }}
run: more out/pubber.out* pubber/out/*/*.json || true
- name: output logs
if: ${{ always() }}
run: cd sites/udmi_site_model/out && more `find . -type f` || true
- name: support bundle
if: ${{ always() }}
run: |
bin/support
mv /tmp/udmi-support_*.tgz ${{ github.repository_owner }}_${{ github.job }}_$(cd /tmp; ls udmi-support_*.tgz)
echo Renamed support file to `ls *_udmi-support_*.tgz`
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: udmi-support_${{ github.run_id }}
path: '*_udmi-support_*.tgz'
comprehensive:
name: Comprehensive Suite
runs-on: ubuntu-latest
timeout-minutes: 35
if: vars.TARGET_PROJECT != ''
env:
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
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: telemetry validator
run: bin/test_validator $TARGET_PROJECT
- name: validator result
if: ${{ always() }}
run: |
cat /tmp/validator.out || true
- name: message captures
if: ${{ always() }}
run: |
cd sites/udmi_site_model/out
find . -type f | sort | xargs more | cat
- name: nostate sequences
if: ${{ always() }}
run: bin/test_sequencer clean alpha nostate full $TARGET_PROJECT
- name: itemized sequencer tests
run: bin/test_itemized $TARGET_PROJECT
- name: itemized output logs
if: ${{ always() }}
run: |
more out/*_itemized.out | cat
more out/sequencer.out-* out/pubber.out-* | cat
- name: tool output logs
if: ${{ always() }}
run: |
more sites/udmi_site_model/out/*.json | cat
- name: pubber output logs
if: ${{ always() }}
run: |
more out/pubber.out* | cat
- name: support bundle
if: ${{ always() }}
run: |
bin/support
mv /tmp/udmi-support_*.tgz ${{ github.repository_owner }}_${{ github.job }}_$(cd /tmp; ls udmi-support_*.tgz)
echo Renamed support file to `ls *_udmi-support_*.tgz`
- uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
if-no-files-found: error
name: udmi-support_${{ github.run_id }}
path: '*_udmi-support_*.tgz'
redirect:
name: Endpoint Redirection
runs-on: ubuntu-latest
needs: comprehensive
timeout-minutes: 10
if: vars.TARGET_PROJECT != ''
env:
TARGET_PROJECT: ${{ vars.TARGET_PROJECT }}
UDMI_ALT_REGISTRY: ${{ vars.UDMI_ALT_REGISTRY }}
MQTT_PROXY_HOST: ${{ vars.MQTT_PROXY_HOST }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
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.out
if: ${{ always() }}
run: more out/pubber.out* | cat