Skip to content

Commit a1a4722

Browse files
committed
[#181] Add CI job for checking latest spec compatibility
Also added OpenFastTrace config files for current and latest spec resources.
1 parent b87a5c3 commit a1a4722

3 files changed

Lines changed: 125 additions & 0 deletions

File tree

.env.oft-current

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
2+
#
3+
# See the NOTICE file(s) distributed with this work for additional
4+
# information regarding copyright ownership.
5+
#
6+
# This program and the accompanying materials are made available under the
7+
# terms of the Apache License Version 2.0 which is available at
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# SPDX-License-Identifier: Apache-2.0
11+
12+
# shellcheck disable=SC2148,SC2034
13+
14+
# The file patterns that specify the relevant parts of the latest uProtocol Specification
15+
# that this component is supposed to implement
16+
UP_SPEC_FILE_PATTERNS="up-spec/*.adoc up-spec/*.md up-spec/basics"
17+
18+
# The file patterns that specify this component's resources which contain specification items
19+
# that cover the requirements
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md *.java pom.xml *.feature .github src"
21+
22+
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
23+
OFT_TAGS="_"

.env.oft-latest

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
2+
#
3+
# See the NOTICE file(s) distributed with this work for additional
4+
# information regarding copyright ownership.
5+
#
6+
# This program and the accompanying materials are made available under the
7+
# terms of the Apache License Version 2.0 which is available at
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# SPDX-License-Identifier: Apache-2.0
11+
12+
# shellcheck disable=SC2148,SC2034
13+
14+
# The file patterns that specify the relevant parts of the latest uProtocol Specification
15+
# that this component is supposed to implement
16+
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"
17+
18+
# The file patterns that specify this component's resources which contain specification items
19+
# that cover the requirements
20+
COMPONENT_FILE_PATTERNS="*.adoc *.md *.java pom.xml *.feature .github src"
21+
22+
OFT_FILE_PATTERNS="$UP_SPEC_FILE_PATTERNS $COMPONENT_FILE_PATTERNS"
23+
OFT_TAGS="_,LanguageLibrary"
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# ********************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************/
13+
14+
# Verifies that this library can be built using the uProtocol Core API from up-spec's main branch.
15+
# Also performs requirements tracing using OpenFastTrace. The job fails if any of the two
16+
# activities fail.
17+
18+
name: Latest uP Spec Compatibility
19+
20+
on:
21+
schedule:
22+
- cron: '0 4 * * *'
23+
workflow_dispatch:
24+
25+
concurrency:
26+
group: ${{ github.ref }}-${{ github.workflow }}
27+
cancel-in-progress: true
28+
29+
env:
30+
RUST_TOOLCHAIN: ${{ vars.RUST_TOOLCHAIN || 'stable' }}
31+
RUSTFLAGS: -Dwarnings
32+
CARGO_TERM_COLOR: always
33+
34+
jobs:
35+
requirements-tracing:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
submodules: "recursive"
41+
- name: Fast-Forward to HEAD revision of uProtocol Spec main branch
42+
run: |
43+
cd "${{ github.workspace }}/up-spec"
44+
echo "Switching to up-spec/main branch ..."
45+
git checkout main
46+
echo "fast-forwarding to HEAD revision ..."
47+
git pull
48+
git status
49+
cd "${{ github.workspace }}"
50+
51+
- name: "Determine OpenFastTrace file patterns from .env file"
52+
uses: xom9ikk/dotenv@v2.3.0
53+
with:
54+
mode: "oft-latest"
55+
load-mode: strict
56+
57+
# run OpenFastTrace first because the action will always succeed and produce
58+
# a tracing report
59+
- name: Run OpenFastTrace
60+
id: run-oft
61+
uses: eclipse-uprotocol/ci-cd/.github/actions/run-oft@main
62+
with:
63+
file-patterns: "${{ env.OFT_FILE_PATTERNS }}"
64+
tags: "${{ env.OFT_TAGS_}}"
65+
66+
# now try to build and run the tests which may fail if incompatible changes
67+
# have been introduced into the uProtocol Core API
68+
- name: Build and Test with Maven
69+
run: mvn -B verify
70+
71+
# This step will only be run if the tests in the previous step have succeeded.
72+
# In that case, we use the exit code produced by the OFT run as the job's
73+
# overall outcome. This means that the job fails if the tests run successfully
74+
# but some of the requirements from up-spec are not covered.
75+
- name: Determine exit status
76+
env:
77+
OFT_EXIT_CODE: ${{ steps.run-oft.outputs.oft-exit-code }}
78+
run: |
79+
exit $OFT_EXIT_CODE

0 commit comments

Comments
 (0)