Skip to content

Commit

Permalink
Merge branch 'devel' into CB-5440-merge-into-internal-db
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisSinelnikov authored Dec 2, 2024
2 parents b527fdd + 85bfcc0 commit 3102be4
Show file tree
Hide file tree
Showing 2,352 changed files with 19,693 additions and 14,202 deletions.
52 changes: 19 additions & 33 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

- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: backend-build-artifacts
path: deploy/cloudbeaver
if-no-files-found: error
working-directory: ./cloudbeaver/deploy

# - name: Archive build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: backend-build-artifacts
# 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
47 changes: 16 additions & 31 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,34 +59,18 @@ jobs:
- name: yarn clean
if: env.skip_cache == 'true'
uses: borales/actions-yarn@v5
with:
dir: webapp
cmd: clean
run: yarn clear

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

- name: build
id: build
uses: borales/actions-yarn@v5
with:
dir: webapp/packages/product-default
cmd: bundle
- 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
with:
name: frontend-build-artifacts
path: webapp/packages/product-default/lib
if-no-files-found: error
# - name: Archive build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: frontend-build-artifacts
# path: webapp/packages/product-default/lib
# if-no-files-found: error
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.

Loading

0 comments on commit 3102be4

Please sign in to comment.