Skip to content

Commit 23f0c6f

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 23f0c6f

File tree

4 files changed

+111
-54
lines changed

4 files changed

+111
-54
lines changed

.github/actions/run-oft/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Run OpenFastTrace CLI's `trace` command on the local `up-rust` workspace.
2+
3+
Considers all (relevant) specification documents from the `up-spec` submodule and all
4+
implementation and documentation artifacts contained in the `up-rust` repository.
5+
6+
The action installs Temurin JDK 17 for running OpenFastTrace (OFT) and has the following outputs:
7+
8+
| Name | Description |
9+
| :-------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
10+
| `requirements-tracing-exit-code` | 0: OFT has run successfully and all specification items are covered<br>1: OFT has either failed to run or at least one specification item is not covered. |
11+
| `requirements-tracing-report-url` | The URL pointing to the HTML report that has been created by OFT. |
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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: Prepare Environment
34+
shell: bash
35+
run: |
36+
echo "TRACING_REPORT_FILE_NAME=requirements-tracing-report.html" >> $GITHUB_ENV
37+
- name: Set up JDK
38+
uses: actions/setup-java@v4
39+
with:
40+
distribution: "temurin"
41+
java-version: "17"
42+
- name: Download OpenFastTrace JARs
43+
shell: bash
44+
env:
45+
OFT_REPO_BASE: "https://github.com/itsallcode"
46+
OFT_CORE_VERSION: "4.1.0"
47+
OFT_ASCIIDOC_PLUGIN_VERSION: "0.2.0"
48+
run: |
49+
mkdir "${{ github.workspace }}/lib"
50+
curl -L -o "${{ github.workspace }}/lib/openfasttrace.jar" \
51+
"${{ env.OFT_REPO_BASE }}/openfasttrace/releases/download/${{ env.OFT_CORE_VERSION }}/openfasttrace-${{ env.OFT_CORE_VERSION }}.jar"
52+
curl -L -o "${{ github.workspace }}/lib/openfasttrace-asciidoc-plugin.jar" \
53+
"${{ 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"
54+
- name: Run OpenFastTrace
55+
id: run-oft
56+
shell: bash
57+
run: |
58+
if java -cp "${{ github.workspace }}/lib/*" \
59+
org.itsallcode.openfasttrace.core.cli.CliStarter trace -o html \
60+
-f "${{ env.TRACING_REPORT_FILE_NAME }}" \
61+
*.md \
62+
*.rs \
63+
.github \
64+
examples \
65+
src \
66+
tests \
67+
tools \
68+
up-spec/*.adoc \
69+
up-spec/*.md \
70+
up-spec/basics \
71+
up-spec/up-l1/README.* \
72+
up-spec/up-l2 \
73+
up-spec/up-l3;
74+
then
75+
echo "requirements-tracing-exit-code=0" >> $GITHUB_OUTPUT
76+
echo "All requirements from uProtocol Specification are covered by crate." >> $GITHUB_STEP_SUMMARY
77+
else
78+
echo "requirements-tracing-exit-code=1" >> $GITHUB_OUTPUT
79+
echo "Some requirements from uProtocol Specification are not covered by crate. See attached report for details." >> $GITHUB_STEP_SUMMARY
80+
fi
81+
82+
- name: Upload tracing report (html)
83+
uses: actions/upload-artifact@v4
84+
id: tracing-report-html
85+
with:
86+
name: tracing-report-html
87+
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)