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