|
| 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 }} |
0 commit comments