|
12 | 12 | # *******************************************************************************/ |
13 | 13 |
|
14 | 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. For that purpose, the workflow requires |
16 | | -# the UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS variable to contain the file patterns to use for |
17 | | -# invoking the "run-oft" Action. |
| 15 | +# Also performs requirements tracing using OpenFastTrace. The job fails if any of the two |
| 16 | +# activities fail. |
18 | 17 |
|
19 | 18 | name: uP Spec Compatibility |
20 | 19 |
|
|
33 | 32 | CARGO_TERM_COLOR: always |
34 | 33 |
|
35 | 34 | jobs: |
36 | | - tests: |
| 35 | + up-spec-check: |
37 | 36 | runs-on: ubuntu-latest |
38 | 37 | steps: |
39 | 38 | - uses: actions/checkout@v4 |
|
49 | 48 | git status |
50 | 49 | cd "${{ github.workspace }}" |
51 | 50 |
|
52 | | - # run OpenFastTrace first because OFT will always succeed and produce |
| 51 | + # run OpenFastTrace first because the action will always succeed and produce |
53 | 52 | # a tracing report |
54 | 53 | - name: Run OpenFastTrace |
| 54 | + id: run-oft |
55 | 55 | uses: eclipse-uprotocol/ci-cd/.github/actions/run-oft@main |
56 | 56 | with: |
57 | 57 | file-patterns: "${{ vars.UP_SPEC_OPEN_FAST_TRACE_FILE_PATTERNS }} ${{ vars.UP_COMPONENT_OPEN_FAST_TRACE_FILE_PATTERNS }}" |
|
70 | 70 | cargo nextest run --all-features |
71 | 71 | # but it cannot execute doc tests |
72 | 72 | cargo test --doc --all-features |
| 73 | +
|
| 74 | + # This step will only be run if the tests in the previous step have succeeded. |
| 75 | + # In that case, we use the exit code produced by the OFT run as the job's |
| 76 | + # overall outcome. This means that the job fails if the tests run successfully |
| 77 | + # but some of the requirements from up-spec are not covered. |
| 78 | + - name: Determine exit status |
| 79 | + env: |
| 80 | + OFT_EXIT_CODE: ${{ steps.run-oft.outputs.oft-exit-code }} |
| 81 | + run: | |
| 82 | + exit $OFT_EXIT_CODE |
0 commit comments