-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf4fece
commit ad9135a
Showing
8 changed files
with
135 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Create New Stable Branch | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Create new branch | ||
env: | ||
ENVIRONMENT: CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
- name: install yq | ||
run: wget https://github.com/mikefarah/yq/releases/download/v4.2.0/yq_linux_amd64 -O ~/yq && chmod +x ~/yq | ||
- name: Maven Version | ||
run: mvn --version | ||
# Retrieve current version from the root pom | ||
- name: Get version | ||
run: | | ||
PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.4.0:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo PROJECT_VERSION=${PROJECT_VERSION} >> $GITHUB_ENV | ||
echo CUR_VERSION=$(echo ${PROJECT_VERSION} | awk -F'.' '{print $1"."$2+0"."$3}' | sed s/[.]$//) >> $GITHUB_ENV | ||
echo NEXT_VERSION=$(echo ${PROJECT_VERSION} | awk -F'.' '{print $1"."$2+1"."$3}' | sed s/[.]$//) >> $GITHUB_ENV | ||
- name: Create branch ${{ env.CUR_VERSION }} | ||
run: git branch ${{ env.CUR_VERSION }} master | ||
- name: Bump next version ${{ env.NEXT_VERSION }}-SNAPSHOT | ||
run: mvn versions:set -DnewVersion=${{ env.NEXT_VERSION }}-SNAPSHOT | ||
- name: Set major version ${{ env.NEXT_VERSION }} | ||
run: mvn versions:set-property -Dproperty=major-version -DnewVersion=${{ env.NEXT_VERSION }} | ||
- name: Update main workflow | ||
run: ~/yq -i e '.on.push.branches |= [ "master", '${{ env.NEXT_VERSION }}' ]' .github/workflows/main.yml | ||
- name: Update Notify clients workflow | ||
run: ~/yq -i e '.on.push.branches |= [ "master", '${{ env.NEXT_VERSION }}' ]' .github/workflows/notify-clients.yml | ||
- name: Commit main branch changes | ||
run: | | ||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config --global user.email "username@users.noreply.github.com" | ||
git commit -a -m "Next is ${{ env.NEXT_VERSION }}" | ||
- name: push branches | ||
run: | | ||
git push master | ||
git push ${{ env.CUR_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,58 @@ | ||
name: Java CI with Maven | ||
|
||
on: | ||
push: | ||
branches: [ master, 0.12.x, 0.13.x ] | ||
tags: [ "*" ] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build on ${{ matrix.os.name }} | ||
strategy: | ||
matrix: | ||
os: | ||
- { | ||
name: "windows-latest", | ||
build-options: "\"-Dquarkus.container-image.build=false\" -pl '!horreum-client, !horreum-integration-tests' -DskipITs -DskipTests" | ||
} | ||
- { | ||
name: "ubuntu-latest", | ||
build-options: "" | ||
} | ||
- {name: "windows-latest", build-options: "\"-Dquarkus.container-image.build=false\" -pl '!horreum-client, !horreum-integration-tests' -DskipITs -DskipTests"} | ||
- {name: "ubuntu-latest", build-options: ""} | ||
env: | ||
ENVIRONMENT: CI | ||
runs-on: ${{ matrix.os.name }} | ||
|
||
runs-on: ${{ matrix.os.name }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Reclaim Disk Space | ||
run: .github/scripts/ci-prerequisites.sh | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
- name: Cache Maven packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Install Hunter | ||
run: pipx install git+https://github.com/datastax-labs/hunter.git | ||
- name: Maven Version | ||
run: mvn --version | ||
- name: Build and Test | ||
run: mvn clean install -B --file pom.xml ${{ matrix.os.build-options }} -P ci | ||
- name: Check uncommitted changes | ||
if: matrix.os.name == 'ubuntu-latest' | ||
run: | | ||
clean=$(git status --porcelain) | ||
if [[ -z "$clean" ]]; then | ||
echo "Empty git status --porcelain: $clean" | ||
else | ||
echo "Uncommitted file changes detected: $clean" | ||
git diff | ||
exit 1 | ||
fi | ||
- name: Upload artifact for failed workflow | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test logs | ||
path: | | ||
*/target/surefire-reports/* | ||
test-suite/target/hyperfoil/*.log | ||
- uses: actions/checkout@v4 | ||
- name: Reclaim Disk Space | ||
run: .github/scripts/ci-prerequisites.sh | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
- name: Cache Maven packages | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Install Hunter | ||
run: pipx install git+https://github.com/datastax-labs/hunter.git | ||
- name: Maven Version | ||
run: mvn --version | ||
- name: Build and Test | ||
run: mvn clean install -B --file pom.xml ${{ matrix.os.build-options }} -P ci | ||
- name: Check uncommitted changes | ||
if: matrix.os.name == 'ubuntu-latest' | ||
run: | | ||
clean=$(git status --porcelain) | ||
if [[ -z "$clean" ]]; then | ||
echo "Empty git status --porcelain: $clean" | ||
else | ||
echo "Uncommitted file changes detected: $clean" | ||
git diff | ||
exit 1 | ||
fi | ||
- name: Upload artifact for failed workflow | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test logs | ||
path: | | ||
*/target/surefire-reports/* | ||
test-suite/target/hyperfoil/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/Version.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
package io.hyperfoil.tools.horreum.api; | ||
|
||
import io.quarkus.logging.Log; | ||
|
||
import java.io.IOException; | ||
import java.util.Properties; | ||
|
||
public class Version { | ||
public static final String VERSION = "0.14.0"; | ||
public static final String getVersion(){ | ||
final Properties properties = new Properties(); | ||
try { | ||
properties.load(Version.class.getClassLoader().getResourceAsStream("build.properties")); | ||
return properties.getProperty("horreum.version"); | ||
} catch (IOException e) { | ||
Log.error("Failed to load version.properties",e); | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters