diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4d69a92..2463d43 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -28,6 +28,7 @@ This is implemented in [`nightly.yaml`](nightly.yaml) In addition to the main workflows described above, there exist a number of modules that are used by these main workflows. They can also be run standalone, and are intendet to make composing the capabilities of our main workflows simpler. These are: +- [`check-up-spec-compatibility.yaml`](check-up-spec-compatibility.yaml) - checks if the current main branch can be built against up-spec's main branch instead of its latest tag/release - [`coverage.yaml`](coverage.yaml) - collects test code coverage, and can optionally upload the results to codecov.io - Will publish coverage data to CodeCov if `${{ secrets.CODECOV_TOKEN }}` is set - outputs: download URL for the workflow-generated coverage info file diff --git a/.github/workflows/check-up-spec-compatibility.yaml b/.github/workflows/check-up-spec-compatibility.yaml new file mode 100644 index 0000000..70ae551 --- /dev/null +++ b/.github/workflows/check-up-spec-compatibility.yaml @@ -0,0 +1,59 @@ +# ******************************************************************************** +# Copyright (c) 2024 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# *******************************************************************************/ + +# Verifies that this crate can be built with the most recent changes from up-spec's main branch + +name: uP Spec Compatibility + +on: + schedule: + - cron: '0 4 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +env: + RUST_TOOLCHAIN: ${{ vars.RUST_TOOLCHAIN || 'stable' }} + RUSTFLAGS: -Dwarnings + CARGO_TERM_COLOR: always + +jobs: + nextest: + # Subset of feature-combos, on only one OS - more complete testing in test-featurematrix.yaml + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + - name: Fast-Forward to HEAD revision of uProtocol Spec main branch + run: | + cd "${{ github.workspace }}/up-spec" + echo "Switching to up-spec/main branch ..." + git checkout main + echo "fast-forwarding to HEAD revision ..." + git pull + git status + cd "${{ github.workspace }}" + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + - uses: Swatinem/rust-cache@v2 + - uses: taiki-e/install-action@nextest + - name: Run tests + run: | + # Using nextest because it's faster than built-in test + cargo nextest run --all-features + # but it cannot execute doc tests + cargo test --doc --all-features