diff --git a/.env.oft-current b/.env.oft-current new file mode 100644 index 00000000..665a4aec --- /dev/null +++ b/.env.oft-current @@ -0,0 +1,23 @@ +# Copyright (c) 2025 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 + +# shellcheck disable=SC2148,SC2034 + +# The file patterns that specify the relevant parts of the latest uProtocol Specification +# that this component is supposed to implement +UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics" + +# The file patterns that specify this component's resources which contain specification items +# that cover the requirements +COMPONENT_FILE_PATTERNS="*.adoc *.md *.java pom.xml *.feature .github src" + +OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS" +OFT_TAGS="_" diff --git a/.env.oft-latest b/.env.oft-latest new file mode 100644 index 00000000..9da0dc10 --- /dev/null +++ b/.env.oft-latest @@ -0,0 +1,23 @@ +# Copyright (c) 2025 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 + +# shellcheck disable=SC2148,SC2034 + +# The file patterns that specify the relevant parts of the latest uProtocol Specification +# that this component is supposed to implement +UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics up-spec/up-l1/README.adoc up-spec/up-l2/api.adoc" + +# The file patterns that specify this component's resources which contain specification items +# that cover the requirements +COMPONENT_FILE_PATTERNS="*.adoc *.md *.java pom.xml *.feature .github src" + +OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS" +OFT_TAGS="_,LanguageLibrary" diff --git a/.github/workflows/latest-up-spec-compatibility.yaml b/.github/workflows/latest-up-spec-compatibility.yaml new file mode 100644 index 00000000..90f5ef8a --- /dev/null +++ b/.github/workflows/latest-up-spec-compatibility.yaml @@ -0,0 +1,79 @@ +# ******************************************************************************** +# Copyright (c) 2025 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 library 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@v4 + 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: xom9ikk/dotenv@v2.3.0 + with: + mode: "oft-latest" + load-mode: strict + + # 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@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 + - name: Build and Test with Maven + run: mvn -B verify + + # 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