Skip to content

Commit

Permalink
[Tool] actions info update (StarRocks#13361)
Browse files Browse the repository at this point in the history
Standardize action naming and support bug fix pr's merge into version hint information
  • Loading branch information
dulong41 authored Nov 15, 2022
1 parent bf3534c commit b55095d
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/add-approve-label.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Add Label
name: add-approve-label

on:
workflow_run:
workflows: ["Label when reviewed"]
workflows: ["reviewer"]
types: ['requested']

permissions:
Expand All @@ -12,9 +12,9 @@ permissions:
pull-requests: write

jobs:
Approve:
add-approve-label:
runs-on: ubuntu-latest
steps:
steps:
- name: "Get information about the original trigger of the run"
uses: potiuk/get-workflow-origin@v1_2
id: source-run-info
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Labels

on:
pull_request_target:
types:
Expand All @@ -8,9 +6,9 @@ on:
- 'docs/**'

jobs:
pr-label:
add-doc-label:
runs-on: ubuntu-latest
steps:
steps:
- name: add document label
uses: actions-ecosystem/action-add-labels@v1
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: project

on:
pull_request_target:
branches:
Expand All @@ -10,10 +8,10 @@ on:
- branch-2.5
types:
- opened
- edited
- reopened

jobs:
autolabel:
cherrypick-check:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
Expand All @@ -28,3 +26,16 @@ jobs:
2.4
2.3
2.2
- uses: thollander/actions-comment-pull-request@v1
if: >
startsWith(github.event.pull_request.title, '[BugFix]') &&
!contains(github.event.pull_request.title, 'cherry-pick') &&
!contains(github.event.pull_request.title, 'backport')
with:
message: |
## Please check the version labels which this pr will be auto backported to target branch and click the checkbox:
- [ ] check done.
GITHUB_TOKEN: ${{ secrets.PAT }}
reactions: eyes
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Review
on:
pull_request_target:
types: [labeled]

jobs:
build:
name: Clang-tidy Check
clang-tidy-check:
runs-on: self-hosted
if: ${{ github.event.label.name == 'be-build' }}
env:
Expand Down Expand Up @@ -42,7 +40,7 @@ jobs:
with:
build_dir: be/build_Release
config_file: .clang-tidy

- name: post build
run: |
sudo rm -rf ../starrocks/*
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: automerge
on:
pull_request_target:
types:
- labeled
jobs:
automerge:
enable-automerge:
runs-on: ubuntu-latest
steps:
- name: enable automerge
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: checker

on:
pull_request_target:
types:
Expand All @@ -10,7 +8,7 @@ on:
- 'fe/**.java'

jobs:
java-codestyle:
java-codestyle-check:
name: "CheckStyle"
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 11 * * 1"
workflow_dispatch:

jobs:
stale:
mark-issue-pr-stale:
runs-on: ubuntu-latest
permissions:
issues: write
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/markdownlint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: markdownlint

on:
on:
pull_request:
types:
- opened
Expand All @@ -10,7 +8,7 @@ on:
- 'docs/**'

jobs:
delivery:
markdownlint:
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand All @@ -22,7 +20,7 @@ jobs:
# - name: git diff file list
# id: diff
# run : echo "files=$(git diff HEAD HEAD^ --name-only -- '*.md')" >> $GITHUB_OUTPUT

- name: markdown lint
uses: nosborn/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: Checker
on:
pull_request_target:
types:
Expand All @@ -9,7 +8,7 @@ on:
- unlabeled

jobs:
Title-Check:
pr-title-check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/[email protected]
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/review-pr-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
name: Label when reviewed
name: reviewer

on: pull_request_review

jobs:
label-when-reviewed:
review-pr-trigger:
name: "Label PRs when reviewed"
runs-on: ubuntu-latest
steps:
steps:
- uses: taichi/[email protected]
id: approved
with:
approvals: '2'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'

- name: create-file
if: steps.approved.outputs.approved == 'true'
run: echo '${{ steps.approved.outputs.approved }}' >> ${{ github.workspace }}/${{ github.event.pull_request.number }}

- run: echo 'false' >> ${{ github.workspace }}/${{ github.event.pull_request.number }}
if: steps.approved.outputs.approved != 'true'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Trigger Jobs

on:
pull_request_target:
types: [synchronize, labeled, reopened]
paths-ignore:
- 'docs/**'

jobs:
Trigger-Admit-Test:
run-admit-test:
runs-on: ubuntu-latest
steps:
steps:
- name: PR comment
if: contains(github.event.pull_request.labels.*.name, 'Approved')
uses: thollander/actions-comment-pull-request@v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: BE Build
on:
pull_request:
types: [labeled]

jobs:
build:
sonarcloud-be-build:
name: BE Sonar Build
runs-on: self-hosted
if: ${{ github.event.label.name == 'be-build' }}
Expand All @@ -14,7 +13,7 @@ jobs:
- name: pre build
run: |
sudo rm -rf ../starrocks/*
- uses: dorny/paths-filter@v2
id: changes
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
name: FE Sonar Build
on:
push:
branches:
Expand All @@ -8,43 +7,47 @@ on:
- 'fe/**.java'
- 'fe/**.xml'
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- 'fe/**.java'
- 'fe/**.xml'

jobs:
build:
sonarcloud-fe-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'

- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven

- name: Setup thrift
uses: dodopizza/setup-thrift@v1
with:
version: 0.13.0

- name: Analyze FE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down

0 comments on commit b55095d

Please sign in to comment.