Skip to content

Commit 70d08c7

Browse files
committed
Include requirements tracing in nightly up-spec compatibility check
Refactored OFT execution into its own composite GitHub Action in order to be able to use it with both, the latest released up-spec as well as the latest up-spec from the main branch.
1 parent 1d1b1a6 commit 70d08c7

File tree

3 files changed

+97
-54
lines changed

3 files changed

+97
-54
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# ********************************************************************************
2+
# Copyright (c) 2024 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+
# Perform requirements tracing against the uProtocol Specification using OpenFastTrace (https://github.com/itsallcode/openfasttrace)
15+
# Returns the URL of the created HTML report as an output
16+
17+
name: "Run OpenFastTrace"
18+
description: |
19+
Runs OpenFastTrace with the trace command on the local up-rust workspace.
20+
outputs:
21+
requirements-tracing-exit-code:
22+
description: |
23+
A flag indicating the outcome of running OpenFastTrace (0: success, 1: failure).
24+
The report is created in any case, as long as OpenFastTrace could be run at all.
25+
value: ${{ steps.run-oft.outputs.requirements-tracing-exit-code }}
26+
requirements-tracing-report-url:
27+
description: "The URL to the OpenFastTrace HTML report"
28+
value: ${{ steps.tracing-report-html.artifact-url }}
29+
30+
runs:
31+
using: "composite"
32+
steps:
33+
- name: Set up JDK
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: "temurin"
37+
java-version: "17"
38+
- name: Download OpenFastTrace JARs
39+
shell: bash
40+
env:
41+
OFT_REPO_BASE: "https://github.com/itsallcode"
42+
OFT_CORE_VERSION: "4.1.0"
43+
OFT_ASCIIDOC_PLUGIN_VERSION: "0.2.0"
44+
run: |
45+
mkdir "${{ github.workspace }}/lib"
46+
curl -L -o "${{ github.workspace }}/lib/openfasttrace.jar" \
47+
"${{ env.OFT_REPO_BASE }}/openfasttrace/releases/download/${{ env.OFT_CORE_VERSION }}/openfasttrace-${{ env.OFT_CORE_VERSION }}.jar"
48+
curl -L -o "${{ github.workspace }}/lib/openfasttrace-asciidoc-plugin.jar" \
49+
"${{ env.OFT_REPO_BASE }}/openfasttrace-asciidoc-plugin/releases/download/${{ env.OFT_ASCIIDOC_PLUGIN_VERSION }}/openfasttrace-asciidoc-plugin-${{ env.OFT_ASCIIDOC_PLUGIN_VERSION }}-with-dependencies.jar"
50+
- name: Run OpenFastTrace
51+
id: run-oft
52+
shell: bash
53+
run: |
54+
echo "TRACING_REPORT_FILE_NAME=requirements-tracing-report.html" >> $GITHUB_ENV
55+
if java -cp "${{ github.workspace }}/lib/*" \
56+
org.itsallcode.openfasttrace.core.cli.CliStarter trace -o html \
57+
-f "${{ env.TRACING_REPORT_FILE_NAME }}" \
58+
*.md \
59+
*.rs \
60+
.github \
61+
examples \
62+
src \
63+
tests \
64+
tools \
65+
up-spec/*.adoc \
66+
up-spec/*.md \
67+
up-spec/basics \
68+
up-spec/up-l1/README.* \
69+
up-spec/up-l2 \
70+
up-spec/up-l3;
71+
then
72+
echo "requirements-tracing-exit-code=0" >> $GITHUB_OUTPUT
73+
echo "All requirements from uProtocol Specification are covered by crate." >> $GITHUB_STEP_SUMMARY
74+
else
75+
echo "requirements-tracing-exit-code=1" >> $GITHUB_OUTPUT
76+
echo "Some requirements from uProtocol Specification are not covered by crate. See attached report for details." >> $GITHUB_STEP_SUMMARY
77+
fi
78+
79+
- name: Upload tracing report (html)
80+
uses: actions/upload-artifact@v4
81+
id: tracing-report-html
82+
with:
83+
name: tracing-report-html
84+
path: ${{ env.TRACING_REPORT_FILE_NAME }}

.github/workflows/check-up-spec-compatibility.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************/
1313

14-
# Verifies that this crate can be built with the most recent changes from up-spec's main branch
14+
# Verifies that this crate can be built using the uProtocol Core API from up-spec's main branch.
15+
# Also performs requirements tracing using OpenFastTrace
1516

1617
name: uP Spec Compatibility
1718

@@ -30,8 +31,7 @@ env:
3031
CARGO_TERM_COLOR: always
3132

3233
jobs:
33-
nextest:
34-
# Subset of feature-combos, on only one OS - more complete testing in test-featurematrix.yaml
34+
tests:
3535
runs-on: ubuntu-latest
3636
steps:
3737
- uses: actions/checkout@v4
@@ -46,6 +46,14 @@ jobs:
4646
git pull
4747
git status
4848
cd "${{ github.workspace }}"
49+
50+
# run OpenFastTrace first because OFT will always succeed and produce
51+
# a tracing report
52+
- name: Run OpenFastTrace
53+
uses: ./.github/actions/run-oft
54+
55+
# now try to build and run the tests which may fail if incomaptible changes
56+
# have been introduced in up-spec
4957
- uses: dtolnay/rust-toolchain@master
5058
with:
5159
toolchain: ${{ env.RUST_TOOLCHAIN }}

.github/workflows/requirements-tracing.yaml

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,69 +25,20 @@ on:
2525
workflow_dispatch:
2626
pull_request:
2727

28-
env:
29-
OFT_REPO_BASE: "https://github.com/itsallcode"
30-
OFT_CORE_VERSION: "4.1.0"
31-
OFT_ASCIIDOC_PLUGIN_VERSION: "0.2.0"
32-
TRACING_REPORT_FILE_NAME: "requirements-tracing-report.html"
33-
3428
jobs:
3529
tracing:
3630
name: Run OpenFastTrace
3731
runs-on: ubuntu-latest
3832
outputs:
39-
requirements-tracing-report-url: ${{ steps.tracing-report-html.outputs.artifact-url }}
33+
requirements-tracing-report-url: ${{ steps.run-oft.outputs.requirements-tracing-report-url }}
4034
steps:
4135
- uses: actions/checkout@v4
4236
with:
4337
submodules: "recursive"
44-
- name: Set up JDK
45-
uses: actions/setup-java@v4
46-
with:
47-
distribution: "temurin"
48-
java-version: "17"
4938

50-
- name: Download OpenFastTrace JARs
51-
run: |
52-
mkdir "${{ github.workspace }}/lib"
53-
curl -L -o "${{ github.workspace }}/lib/openfasttrace.jar" \
54-
"${{ env.OFT_REPO_BASE }}/openfasttrace/releases/download/${{ env.OFT_CORE_VERSION }}/openfasttrace-${{ env.OFT_CORE_VERSION }}.jar"
55-
curl -L -o "${{ github.workspace }}/lib/openfasttrace-asciidoc-plugin.jar" \
56-
"${{ env.OFT_REPO_BASE }}/openfasttrace-asciidoc-plugin/releases/download/${{ env.OFT_ASCIIDOC_PLUGIN_VERSION }}/openfasttrace-asciidoc-plugin-${{ env.OFT_ASCIIDOC_PLUGIN_VERSION }}-with-dependencies.jar"
5739
- name: Run OpenFastTrace
5840
id: run-oft
59-
shell: bash
60-
run: |
61-
if java -cp "${{ github.workspace }}/lib/*" \
62-
org.itsallcode.openfasttrace.core.cli.CliStarter trace -o html \
63-
-f "${{ env.TRACING_REPORT_FILE_NAME }}" \
64-
*.md \
65-
*.rs \
66-
.github \
67-
examples \
68-
src \
69-
tests \
70-
tools \
71-
up-spec/*.adoc \
72-
up-spec/*.md \
73-
up-spec/basics \
74-
up-spec/up-l1/README.* \
75-
up-spec/up-l2 \
76-
up-spec/up-l3;
77-
then
78-
echo "requirements-tracing-exit-code=0" >> $GITHUB_OUTPUT
79-
echo "All requirements from uProtocol Specification are covered by crate." >> $GITHUB_STEP_SUMMARY
80-
else
81-
echo "requirements-tracing-exit-code=1" >> $GITHUB_OUTPUT
82-
echo "Some requirements from uProtocol Specification are not covered by crate. See attached report for details." >> $GITHUB_STEP_SUMMARY
83-
fi
84-
85-
- name: Upload tracing report (html)
86-
uses: actions/upload-artifact@v4
87-
id: tracing-report-html
88-
with:
89-
name: tracing-report-html
90-
path: ${{ env.TRACING_REPORT_FILE_NAME }}
41+
uses: ./.github/actions/run-oft
9142

9243
- name: "Determine exit code"
9344
run: |

0 commit comments

Comments
 (0)