Skip to content

Latest uP Spec Compatibility #403

Latest uP Spec Compatibility

Latest uP Spec Compatibility #403

# ********************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************/
# Verifies that this crate can be built using the uProtocol Core API from up-spec's main branch.
# Also performs requirements tracing using OpenFastTrace. The job fails if any of the two
# activities fail.
name: Latest uP Spec Compatibility
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
RUST_TOOLCHAIN: ${{ vars.RUST_TOOLCHAIN || 'stable' }}
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always
jobs:
requirements-tracing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: "recursive"
- name: Fast-Forward to HEAD revision of uProtocol Spec main branch
run: |
cd "${{ github.workspace }}/up-spec"
echo "Switching to up-spec/main branch ..."
git checkout main
echo "fast-forwarding to HEAD revision ..."
git pull
git status
cd "${{ github.workspace }}"
- name: "Determine OpenFastTrace file patterns from .env file"
uses: falti/dotenv-action@73fafca04177425fd3e0a0849257015ae9d42034 # v1.2.0
with:
path: .env.oft-latest
export-variables: true
keys-case: bypass
# run OpenFastTrace first because the action will always succeed and produce
# a tracing report
- name: Run OpenFastTrace
id: run-oft
uses: eclipse-uprotocol/ci-cd/.github/actions/run-oft@c9fb74b20429e69c15021c64dcf343447a2f46a2 # main
with:
file-patterns: "${{ env.OFT_FILE_PATTERNS }}"
tags: "${{ env.OFT_TAGS_}}"
# now try to build and run the tests which may fail if incompatible changes
# have been introduced into the uProtocol Core API
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Run tests
run: |
# We need to use standard "cargo test" here because nextest cannot execute
# cucumber based integration tests which do not use the standard test harness.
cargo test --all-features --all-targets
cargo test --all-features --doc
# This step will only be run if the tests in the previous step have succeeded.
# In that case, we use the exit code produced by the OFT run as the job's
# overall outcome. This means that the job fails if the tests run successfully
# but some of the requirements from up-spec are not covered.
- name: Determine exit status
env:
OFT_EXIT_CODE: ${{ steps.run-oft.outputs.oft-exit-code }}
run: |
exit $OFT_EXIT_CODE