Skip to content

Commit

Permalink
Merge branch 'main' into issues/64
Browse files Browse the repository at this point in the history
  • Loading branch information
Haarolean authored Mar 1, 2024
2 parents c9e2dd5 + 481df49 commit 0ec3c39
Show file tree
Hide file tree
Showing 48 changed files with 926 additions and 686 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ updates:
open-pull-requests-limit: 10
labels:
- "type/dependencies"
- "scope/infrastructure"
- "scope/infra"
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
echo "Packer will be triggered in this dir $WORK_DIR"
- name: Configure AWS credentials for Kafka-UI account
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_AMI_PUBLISH_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_AMI_PUBLISH_KEY_SECRET }}
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/backend_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Backend: Main: Build and test"

on:
push:
branches: [ "main" ]
paths:
- "pom.xml"
- "contract/**"
- "api/**"
- "serde-api/**"

permissions:
contents: read
checks: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/backend_tests.yml
with:
event_name: ${{ github.event_name }}
26 changes: 26 additions & 0 deletions .github/workflows/backend_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Backend: PR: Build and test"

on:

pull_request_target:
types: [ "opened", "reopened", "synchronize" ]
paths:
- "pom.xml"
- "contract/**"
- "api/**"
- "serde-api/**"

permissions:
contents: read
checks: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/backend_tests.yml
with:
event_name: ${{ github.event_name }}
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
name: "Backend: PR/main build & test"
name: "Backend: build and test"

on:
push:
branches: [ "main" ]
paths: &backend_paths
- "pom.xml"
- "contract/**"
- "api/**"
- "serde-api/**"

pull_request_target:
types: [ "opened", "reopened", "synchronize" ]
paths: *backend_paths
workflow_call:
inputs:
event_name:
description: 'Original github.event_name'
required: true
type: string

permissions:
contents: read
checks: write
pull-requests: write

Expand All @@ -25,7 +21,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

Expand All @@ -43,8 +39,8 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and analyze pull request target
if: ${{ github.event_name == 'pull_request' }}
- name: "Pull request: Maven tests & sonar"
if: ${{ inputs.event_name == 'pull_request' || inputs.event_name == 'pull_request_target' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }}
Expand All @@ -60,8 +56,8 @@ jobs:
-Dsonar.pullrequest.branch=$HEAD_REF \
-Dsonar.pullrequest.base=$BASE_REF
- name: Build and analyze push main
if: ${{ github.event_name == 'push' }}
- name: "Main: Maven tests & sonar"
if: ${{ inputs.event_name == 'push' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/branch-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: "Infra: Feature Testing: Init env"

on:
workflow_dispatch:

pull_request:
types: ['labeled']

permissions:
contents: read

jobs:
build:
if: ${{ github.event.label.name == 'status/feature_testing' || github.event.label.name == 'status/feature_testing_public' }}
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
- name: get branch name
id: extract_branch
run: |
Expand Down Expand Up @@ -48,7 +51,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
- name: Configure AWS credentials for Kafka-UI account
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/branch-remove.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
name: "Infra: Feature Testing: Destroy env"

on:
workflow_dispatch:
pull_request:
types: ['unlabeled', 'closed']

permissions:
contents: read

jobs:
remove:
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read
if: ${{ (github.event.label.name == 'status/feature_testing' || github.event.label.name == 'status/feature_testing_public') || (github.event.action == 'closed' && (contains(github.event.pull_request.labels.*.name, 'status/feature_testing') || contains(github.event.pull_request.labels.*.name, 'status/feature_testing_public'))) }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
- name: clone
run: |
git clone https://infra-tech:${{ secrets.INFRA_USER_ACCESS_TOKEN }}@github.com/kafbat/ui-infra.git --branch envs
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/build-public-image.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: "Infra: Image Testing: Deploy"

on:
workflow_dispatch:
pull_request:
types: ['labeled']

permissions:
contents: read

jobs:
build:
if: ${{ github.event.label.name == 'status/image_testing' }}
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
- name: get branch name
id: extract_branch
run: |
Expand Down Expand Up @@ -45,7 +48,7 @@ jobs:
restore-keys: |
${{ runner.os }}-buildx-
- name: Configure AWS credentials for Kafka-UI account
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -68,7 +71,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: make comment with private deployment link
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ on:
schedule:
- cron: '39 15 * * 6'

permissions:
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -32,10 +33,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

Expand All @@ -47,7 +48,7 @@ jobs:
cache: 'maven'

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
8 changes: 5 additions & 3 deletions .github/workflows/cve.yaml → .github/workflows/cve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
# * is a special character in YAML so you have to quote this string
- cron: '0 8 15 * *'

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read

steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}

- name: Set up JDK
uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-public-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
tag='${{ github.event.pull_request.number }}'
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: Configure AWS credentials for Kafka-UI account
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/e2e-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ on:
required: false
type: string

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
ref: ${{ github.sha }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -88,4 +89,4 @@ jobs:
target_url: http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com/${{ github.run_number }}
- name: Dump Docker logs on failure
if: failure()
uses: jwalton/[email protected].1
uses: jwalton/[email protected].2
7 changes: 4 additions & 3 deletions .github/workflows/e2e-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ on:
required: true
type: string

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest
permissions: # TODO remove when public
contents: read
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
ref: ${{ github.sha }}
- name: Set up environment
id: set_env_values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ on:
- "frontend/**"
- "e2e-tests/**"

permissions: # TODO remove when public
statuses: write
permissions:
contents: read
statuses: write

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }} # TODO remove when public
token: ${{ github.token }}
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v3
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -84,4 +84,4 @@ jobs:
target_url: http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com/${{ github.run_number }}
- name: Dump docker logs on failure
if: failure()
uses: jwalton/[email protected].1
uses: jwalton/[email protected].2
Loading

0 comments on commit 0ec3c39

Please sign in to comment.