Skip to content

Commit

Permalink
Merge branch 'devel' into CB-5458-transaction-logs-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud authored Oct 16, 2024
2 parents 8a86808 + ac93769 commit e07b7d3
Show file tree
Hide file tree
Showing 2,313 changed files with 19,639 additions and 30,840 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/backend-build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
name: Backend Build

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allows you to reuse workflows by referencing their YAML files
workflow_call:

jobs:
build-backend:
name: Backend
name: Build
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
path: cloudbeaver

- name: Clone Deps Repositories
uses: dbeaver/github-actions/clone-repositories@devel
with:
project_deps_path: './cloudbeaver/project.deps'

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -23,34 +27,16 @@ jobs:
java-version: "17"
cache: maven

- uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0

- name: Give permissions
run: |
sudo chmod 777 ../
shell: bash

- name: Determine branches
id: determine-branch
run: |
echo "pr_branch=${{ github.head_ref }}" >> $GITHUB_ENV
echo "base_branch=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
- name: Clone dbeaver/dbeaver
id: clone-repo
run: |
git clone -b ${{ env.pr_branch }} https://github.com/dbeaver/dbeaver.git ../dbeaver || git clone -b ${{ env.base_branch }} https://github.com/dbeaver/dbeaver.git ../dbeaver
- uses: dbeaver/github-actions/install-maven@devel

- name: Run build script
run: ./build-backend.sh
shell: bash
working-directory: ./deploy
working-directory: ./cloudbeaver/deploy

- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: backend-build-artifacts
path: deploy/cloudbeaver
path: cloudbeaver/deploy/cloudbeaver
if-no-files-found: error
40 changes: 0 additions & 40 deletions .github/workflows/backend-lint.yml

This file was deleted.

57 changes: 7 additions & 50 deletions .github/workflows/common-cleanup.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,14 @@
name: Cleanup checks
name: Cleanup

on:
pull_request:
types: [closed]
push:
branches:
- devel

jobs:
delete-caches:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

# delete-docker-image:
# name: Delete Docker Image
# if: github.event.pull_request.merged == true
# runs-on: ubuntu-latest

# steps:
# - name: Check out the repository
# uses: actions/checkout@v4

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Determine Docker Image Tag
# run: |
# REPO_NAME=$(basename ${{ github.repository }})
# IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/$REPO_NAME
# BRANCH_NAME=${{ github.event.pull_request.head.ref }}
# TAG_NAME=$(echo $BRANCH_NAME | sed 's/[^a-zA-Z0-9._-]/-/g')
# echo "image=$IMAGE_NAME:$TAG_NAME" >> $GITHUB_ENV

# - name: Log in to GitHub Container Registry
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin

# - name: Delete Docker Image
# run: |
# docker rmi ${{ env.image }}
# echo "Deleted image: ${{ env.image }}"
name: Cleanup
uses: dbeaver/dbeaver-common/.github/workflows/cleanup-caches.yml@devel
secrets: inherit
37 changes: 11 additions & 26 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Frontend Build

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allows you to reuse workflows by referencing their YAML files
workflow_call:
outputs:
Expand All @@ -20,8 +17,11 @@ on:

jobs:
frontend-build:
name: Frontend
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read

outputs:
build-status: ${{ steps.build.outcome }}
Expand All @@ -34,6 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "20"
Expand All @@ -58,30 +59,14 @@ jobs:
- name: yarn clean
if: env.skip_cache == 'true'
uses: borales/actions-yarn@v5
with:
dir: webapp
cmd: clean

- name: yarn install --frozen-lockfile
uses: borales/actions-yarn@v5
with:
dir: webapp
cmd: install
run: yarn clear

- name: build
id: build
uses: borales/actions-yarn@v5
with:
dir: webapp/packages/product-default
cmd: bundle
- run: yarn install --immutable

- run: yarn bundle
working-directory: ./webapp/packages/product-default

- name: test
id: test
uses: borales/actions-yarn@v5
with:
dir: webapp
cmd: test
- run: yarn test

- name: Archive build artifacts
uses: actions/upload-artifact@v4
Expand Down
38 changes: 19 additions & 19 deletions .github/workflows/frontend-lint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Frontend Lint

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allows you to reuse workflows by referencing their YAML files
workflow_call:

jobs:
lint:
name: Frontend
name: Lint
runs-on: ubuntu-latest

timeout-minutes: 5
permissions:
contents: read

defaults:
run:
working-directory: ./webapp

steps:
- uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "20"
Expand All @@ -29,17 +34,12 @@ jobs:
restore-keys: |
${{ runner.os }}-node_modules-
- name: yarn install --frozen-lockfile
uses: borales/actions-yarn@v5
with:
dir: webapp
cmd: install

- name: Lint
uses: reviewdog/action-eslint@v1
with:
reporter: github-pr-review
filter_mode: file
workdir: webapp
fail_on_error: true
eslint_flags: "--ext .ts,.tsx"
- run: |
yarn install --immutable
git fetch origin "${{ github.base_ref }}" --depth=1
FILES=$(git diff --name-only 'origin/${{ github.base_ref }}' ${{ github.sha }} -- . | sed 's|^webapp/||')
if [ -n "$FILES" ]; then
yarn lint --pass-on-no-patterns --no-error-on-unmatched-pattern $FILES
else
echo "No files to lint"
fi
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
name: Check
name: CI

on:
push:
branches:
- devel
pull_request:
branches:
- devel
types:
- opened
- synchronize
- reopened
push:
branches: [devel]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
skip_cache:
description: "Skip cache restoration"
required: false
default: "false"
concurrency:
group: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'push-pr-devel' }}
cancel-in-progress: true

jobs:
call-backend-build:
name: Build
build-server:
name: Server
uses: ./.github/workflows/backend-build.yml
secrets: inherit

call-frontend-build:
name: Build
build-frontend:
name: Frontend
uses: ./.github/workflows/frontend-build.yml
with:
skip_cache: ${{ github.event.inputs.skip_cache }}
secrets: inherit

call-frontend-lint:
name: Lint
needs: call-frontend-build
uses: ./.github/workflows/frontend-lint.yml
lint-server:
name: Server
uses: dbeaver/dbeaver-common/.github/workflows/java-checkstyle.yml@devel
secrets: inherit

call-backend-lint:
name: Lint
uses: ./.github/workflows/backend-lint.yml
lint-frontend:
name: Frontend
uses: ./.github/workflows/frontend-lint.yml
secrets: inherit

# call-frontend-tests:
# name: Frontend Unit Tests
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/validation.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ server/test/io.cloudbeaver.test.platform/workspace/.data/
.classpath
.settings/

## Eclipse PDE
*.product.launch

workspace-dev-ce/
deploy/cloudbeaver
server/**/target
Expand Down
Loading

0 comments on commit e07b7d3

Please sign in to comment.