diff --git a/.github/workflows/oft.yaml b/.github/workflows/oft.yaml new file mode 100644 index 00000000..d9394b1d --- /dev/null +++ b/.github/workflows/oft.yaml @@ -0,0 +1,27 @@ +name: Check Bazel Tests + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: + run: + + - name: Run HTML Report + run: | + bash .github/workflow/scripts/run_oft.sh ./exaudfclient base -o html -f ./oft_report.html || echo failed + - name: Run Plaintext Report + run: | + bash .github/workflow/scripts/run_oft.sh ./exaudfclient base + - uses: actions/upload-artifact@v4 + if: always() + with: + name: "oft_report.html" + path: oft_report.html diff --git a/.github/workflows/scripts/run_oft.sh b/.github/workflows/scripts/run_oft.sh new file mode 100644 index 00000000..2762eee2 --- /dev/null +++ b/.github/workflows/scripts/run_oft.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +oft_version="4.1.0" + +base_dir="$1" +shift 1 +src_dir="$2" +shift 1 +additional_options=$@ +readonly base_dir +readonly oft_jar="$HOME/.m2/repository/org/itsallcode/openfasttrace/openfasttrace/$oft_version/openfasttrace-$oft_version.jar" + +if [ ! -f "$oft_jar" ]; then + echo "Downloading OpenFastTrace $oft_version" + mvn --batch-mode org.apache.maven.plugins:maven-dependency-plugin:3.3.0:get -Dartifact=org.itsallcode.openfasttrace:openfasttrace:$oft_version +fi + +# Trace all +java -jar "$oft_jar" trace \ + $additional_options \ + -a feat,req,dsn \ + "$base_dir/doc" \ + "$base_dir/$src_dir"