Skip to content

Commit

Permalink
Merge pull request #439 from FgForrest/dev
Browse files Browse the repository at this point in the history
Regular performance tests
  • Loading branch information
novoj authored Jan 25, 2024
2 parents 2359802 + 6e0e171 commit 6457583
Show file tree
Hide file tree
Showing 1,948 changed files with 260,672 additions and 25,781 deletions.
32 changes: 32 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
latest: 'true'

prerelease: true
prerelease-identifier: 'alpha'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
autolabeler:
- label: 'bug'
branch:
- '/fix\/.+/'
title:
- '/fix/i'
- label: 'enhancement'
branch:
- '/feature\/.+/'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

template: |
## Changes
$CHANGES
2 changes: 1 addition & 1 deletion .github/workflows/ci-dev-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.X' # setup dotnet 7.0.10 for building
dotnet-version: '8.0.X' # setup dotnet 8.0.X for building

- name: Build with Maven # run Maven with tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths: # but react only to changes in code or pipeline definition
- evita*/**/*.java
- evita*/**/pom.xml
- jacoco/**/pom.xml
- docker/**.*
- .github/**.*
pull_request_target:
Expand Down
81 changes: 79 additions & 2 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Main build pipeline, operates on `master` branch which is our integration branch
# Main build pipeline, operates on `master` branch which is our integration branch and creates release

name: CI Master branch

Expand All @@ -8,6 +8,7 @@ on:
paths: # but react only to changes in code or pipeline definition
- evita*/**/*.java
- evita*/**/pom.xml
- jacoco/**/pom.xml
- evita*/**/dist/**.*
- docker/**.*
- .github/**.*
Expand All @@ -18,10 +19,33 @@ concurrency:

jobs:
build:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
outputs:
release_id: ${{ steps.create_release.outputs.id }}
released_version: ${{ steps.release_version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3 # checkout sources
with:
ref: ${{ github.head_ref }}
fetch-depth: 0

- name: Resolve new release version
id: release_version
uses: lukashornych/[email protected]
with:
prefix: 'v'
year_switch_mode: 'OnMinor'
minor-identifier: '/feat(?:\\([^)]+\\))?:/'

- name: Setup Java JDK
uses: actions/setup-java@v3 # setup JDK 17 for building
Expand All @@ -36,12 +60,65 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Build with Maven # run Maven without tests (tests must pass in dev branch)
run: mvn -T 1C -B deploy -Dmaven.test.skip=true --file pom.xml
run: |
export CURRENT_VERSION="${{ steps.release_version.outputs.version }}"
export NEW_VERSION="$( echo ${CURRENT_VERSION} | sed 's/^v//')"
mvn versions:set -DnewVersion=$NEW_VERSION
mvn -T 1C -B -P release-sign-artifacts -Dmaven.test.skip=true deploy --file pom.xml
env:
EVITA_BUILD_VERSION: ${{ steps.release_version.outputs.version }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Create distribution directory
run: |
mkdir -p ./dist
cp LICENSE ./dist
cp 'evita_server/target/evita-server.jar' ./dist
cp 'evita_server/dist/run.sh' './dist'
cp 'evita_server/dist/logback.xml' './dist'
cp 'docker/evita-configuration.yaml' './dist'
- name: Create .zip of dist
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'dist.zip'
path: './dist'

- name: Create .tar.gz of dist
uses: thedoctor0/[email protected]
with:
type: 'tar'
filename: 'dist.tar.gz'
path: './dist'

- name: Create release
id: create_release
uses: release-drafter/release-drafter@v5
with:
version: ${{ steps.release_version.outputs.version }}
publish: true

- name: Upload dist.zip to release
uses: actions/upload-release-asset@v1
if: success()
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: Dist (zip)
asset_content_type: application/zip

- name: Upload dist.tar.gz to release
uses: actions/upload-release-asset@v1
if: success()
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.tar.gz
asset_name: Dist (tar.gz)
asset_content_type: application/gzip

- name: Upload evitaDB server artifact # upload `evita-server.jar` for `docker-latest.yml` to deploy to DockerHub
uses: actions/upload-artifact@v2
if: success()
Expand Down
52 changes: 32 additions & 20 deletions .github/workflows/docker-canary.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This job builds and deploys Docker image to DockerHub

name: DockerHub-deploy
name: DockerHub-deploy-canary

on:
workflow_run:
Expand All @@ -13,33 +13,45 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3 # checkout from Git
- name: Checkout
uses: actions/checkout@v4 # checkout from Git

- name: Download a single artifact # download `evita-server.jar` artifact if the workflow we react to was successful
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: evita-server.jar
path: docker

- name: Build the Docker image # now build the Docker image, login to DockerHub and push it, then clean everything
- name: Set up QEMU
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
platforms: linux/amd64,linux/arm64/v8

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ vars.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}

- name: Build and push Docker image
env:
BUILD_ROOT: docker
CI_REGISTRY: ${{vars.CI_REGISTRY}}
CI_REGISTRY_IMAGE: ${{vars.CI_REGISTRY_IMAGE}}
RELEASE_IMAGE: "evitadb:canary"
CI_REGISTRY_USER: ${{vars.CI_REGISTRY_USER}}
CI_REGISTRY_PASSWORD: ${{secrets.CI_REGISTRY_PASSWORD}}
EVITA_JAR_NAME: evita-server.jar
run: |
echo "Evita JAR name: $EVITA_JAR_NAME"
echo "Build root: $BUILD_ROOT"
mv -v "$EVITA_JAR_NAME" "$BUILD_ROOT/$EVITA_JAR_NAME"
ls -la $BUILD_ROOT
$BUILD_ROOT/build.sh
echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
echo "Pushing image: $CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker push "$CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker logout "$CI_REGISTRY"
echo "Cleaning"
docker rmi "$CI_REGISTRY_USER/$RELEASE_IMAGE"
uses: docker/build-push-action@v3
with:
context: ./docker
file: ./docker/Dockerfile
pull: true
push: true
tags: ${{ vars.CI_REGISTRY_USER }}/${{ env.RELEASE_IMAGE }}
platforms: linux/amd64,linux/arm64/v8
build-args: |
EVITA_JAR_NAME=${{ env.EVITA_JAR_NAME }}
47 changes: 29 additions & 18 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,36 @@ jobs:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: evita-server.jar
path: docker

- name: Build the Docker image # now build the Docker image, login to DockerHub and push it, then clean everything
- name: Set up QEMU
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
platforms: linux/amd64,linux/arm64/v8

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ vars.CI_REGISTRY_USER }}
password: ${{ secrets.CI_REGISTRY_PASSWORD }}

- name: Build and push Docker image
env:
BUILD_ROOT: docker
CI_REGISTRY: ${{vars.CI_REGISTRY}}
CI_REGISTRY_IMAGE: ${{vars.CI_REGISTRY_IMAGE}}
RELEASE_IMAGE: "evitadb:latest"
CI_REGISTRY_USER: ${{vars.CI_REGISTRY_USER}}
CI_REGISTRY_PASSWORD: ${{secrets.CI_REGISTRY_PASSWORD}}
EVITA_JAR_NAME: evita-server.jar
run: |
echo "Evita JAR name: $EVITA_JAR_NAME"
echo "Build root: $BUILD_ROOT"
mv -v "$EVITA_JAR_NAME" "$BUILD_ROOT/$EVITA_JAR_NAME"
ls -la $BUILD_ROOT
$BUILD_ROOT/build.sh
echo "$CI_REGISTRY_PASSWORD" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
echo "Pushing image: $CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker push "$CI_REGISTRY_IMAGE/$CI_REGISTRY_USER/$RELEASE_IMAGE"
docker logout "$CI_REGISTRY"
echo "Cleaning"
docker rmi "$CI_REGISTRY_USER/$RELEASE_IMAGE"
uses: docker/build-push-action@v3
with:
context: ./docker
file: ./docker/Dockerfile
pull: true
push: true
tags: ${{ vars.CI_REGISTRY_USER }}/${{ env.RELEASE_IMAGE }}
platforms: linux/amd64,linux/arm64/v8
build-args: |
EVITA_JAR_NAME=${{ env.EVITA_JAR_NAME }}
6 changes: 6 additions & 0 deletions .idea/GitLink.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions .idea/inspectionProfiles/Evita_DB_Defaults.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6457583

Please sign in to comment.