Skip to content

refactor: streamline tag filtering logic in SpecFilter (#5256) #529

refactor: streamline tag filtering logic in SpecFilter (#5256)

refactor: streamline tag filtering logic in SpecFilter (#5256) #529

Workflow file for this run

name: Build Test Deploy master
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 17 ]
steps:
- uses: actions/checkout@v6
- name: Set up Java
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: temurin
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache local Maven repository
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk${{ matrix.java }}-maven-v2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk${{ matrix.java }}-maven-v2-
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
with:
cache-provider: basic
- name: Check swagger-bom version matches root version
run: |
ROOT_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
BOM_VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec --file modules/swagger-bom/pom.xml)
echo "Root version: ${ROOT_VERSION}"
echo "BOM version: ${BOM_VERSION}"
if [ "${ROOT_VERSION}" != "${BOM_VERSION}" ]; then
echo "ERROR: swagger-bom version (${BOM_VERSION}) does not match root version (${ROOT_VERSION}). Update modules/swagger-bom/pom.xml."
exit 1
fi
- name: Check project snapshot version
id: project-version
run: |
export MY_POM_VERSION=`./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
echo "POM VERSION" ${MY_POM_VERSION}
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
then
echo "is_snapshot=true" >> $GITHUB_OUTPUT
else
echo "is_snapshot=false" >> $GITHUB_OUTPUT
echo "not building and maven publishing project as it is a release version: " ${MY_POM_VERSION}
fi
- name: Build with Maven
if: steps.project-version.outputs.is_snapshot == 'true'
run: ./mvnw --no-transfer-progress -B -e install --file pom.xml
- name: Upload Maven test reports
if: failure()
uses: actions/upload-artifact@v6
with:
name: surefire-reports-java-${{ matrix.java }}
path: |
**/target/surefire-reports/**
**/target/failsafe-reports/**
- name: Build Gradle plugin
if: steps.project-version.outputs.is_snapshot == 'true'
working-directory: modules/swagger-gradle-plugin
run: ./gradlew build --info --stacktrace --no-daemon
- name: Deploy snapshot to maven central
if: steps.project-version.outputs.is_snapshot == 'true' && matrix.java == 11
run: ./mvnw --no-transfer-progress -B clean deploy -e
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
- name: Verify BOM integration test
run: ./mvnw --no-transfer-progress -B validate -Pbom-it