Skip to content

Commit

Permalink
Improve CI with cancel & concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
yaooqinn committed Mar 18, 2022
1 parent 78a9726 commit dbe8999
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 13 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Style check

# This GitHub workflow checks style & dependency issues.

on:
pull_request:
branches:
- master
- branch-*
paths:
- '**pom.xml'

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

env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.defaultLogLevel=error

jobs:
linter:
name: Style and Dependency check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup JDK 8
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
cache: 'maven'
check-latest: false
- name: Maven install
run: >-
build/mvn -T 4 clean install -Pflink-provided,spark-provided
-Dmaven.javadoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip -DskipTests
-pl kyuubi-ctl,kyuubi-server,kyuubi-assembly -am
- name: Check dependency list
run: build/dependency.sh
19 changes: 6 additions & 13 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ concurrency:
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.defaultLogLevel=error

# no install runs before style check because it is expensive, we can skip build if style fails
# Well, sometimes when we introduce a new module, it may 'fail' the style check for missing
# dependency we just create for other module to inherit.
# We can ignore this failure and merge the PR, if we see the style check pass on the new module
# or via a local quick verification.
jobs:
linter:
name: Style and Dependency check
name: Style check
runs-on: ubuntu-20.04
strategy:
matrix:
Expand All @@ -56,15 +61,3 @@ jobs:
run: for log in `find * -name "scalastyle-output.xml"`; do echo "=========$log========="; grep "error" $log; done
- name: JavaStyle with maven
run: build/mvn -T 4 spotless:check ${{ matrix.profiles }} -pl '!:kyuubi-codecov_2.12,!:kyuubi-assembly_2.12'
- name: Maven install
# run install after style check because it is expensive, we can skip build if style fails
# Well, sometimes when we introduce a new module, it may 'fail' the style check for missing
# dependency we just create for other module to inherit.
# We can ignore this failure and merge the PR, if we see the style check pass on the new module
# or via a local quick verification.
run: >-
build/mvn -T 4 clean install -Pflink-provided,spark-provided
-Dmaven.javadoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip -DskipTests
-pl kyuubi-ctl,kyuubi-server,kyuubi-assembly -am
- name: Check dependency list
run: build/dependency.sh

0 comments on commit dbe8999

Please sign in to comment.