Skip to content

OPEN-99: read cvc

OPEN-99: read cvc #34

Workflow file for this run

# SPDX-FileCopyrightText: Copyright 2025 gematik GmbH
#
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# *******
#
# For additional notes and disclaimer from gematik and in case of changes by gematik,
# find details in the "Readme" file.
name: Rust CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
jobs:
branch_naming:
name: Branch naming
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Validate branch name
run: |
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}"
if [[ -z "${BRANCH_NAME}" ]]; then
echo "No branch name detected (likely a tag). Skipping branch naming check."
exit 0
fi
case "${BRANCH_NAME}" in
main|develop|dependabot/*)
echo "Branch '${BRANCH_NAME}' is allowed."
exit 0
;;
esac
if [[ "${BRANCH_NAME}" =~ ^(feature|bugfix|hotfix|release|chore|docs|test)/open-[A-Za-z0-9._-]+$ ]]; then
echo "Branch '${BRANCH_NAME}' matches the expected naming convention."
exit 0
fi
echo "::error::Branch '${BRANCH_NAME}' does not follow the expected naming convention."
echo "::error::Branch name must match: (feature|bugfix|hotfix|release|chore|docs|test)/open-[A-Za-z0-9._-]+"
exit 1
license_compliance:
name: License compliance
runs-on: ubuntu-latest
needs: branch_naming
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: REUSE Lint
uses: fsfe/reuse-action@v6
with:
args: lint
build:
name: Build & Test
runs-on: ubuntu-latest
needs: branch_naming
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust
- name: Install toolchains
run: |
rustup component add clippy
rustup toolchain install nightly --profile minimal --component rustfmt
- name: Check formatting
run: cargo +nightly fmt --all -- --check
- name: Lint with clippy
run: cargo clippy --workspace --all-targets --no-default-features --features ci -- -D warnings
- name: Build
run: cargo build --workspace --no-default-features --features ci --locked --verbose
- name: Run tests
run: cargo test --workspace --no-default-features --features ci --locked --verbose