Will-Lo commented on a change in pull request #3206: URL: https://github.com/apache/incubator-gobblin/pull/3206#discussion_r561446318
########## File path: .github/workflows/build_and_test.yaml ########## @@ -0,0 +1,164 @@ +# +# 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: Build and Run Tests + +on: + push: + # Publish only on `master` + branches: + - master + pull_request: + branches: + - master + release: + types: [published, edited] + +jobs: + build: + name: Build repository + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + # Stores external dependencies, can be further improved with Gradle 6.1 + - name: Cache Gradle Dependencies + uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + # Only rebuild cache if build.gradle is changed + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle + - name: Build repository + run: | + ./gradlew --no-daemon clean build -x test -x javadoc -x findbugsMain -x findbugsTest -x checkstyleMain -x checkstyleJmh -x checkstyleTest -Dorg.gradle.parallel=true + + test_coverage: + runs-on: ubuntu-latest + name: Generate test coverage + needs: build + steps: Review comment: Jobs have the ability to be run in parallel, and steps do not. Since the test coverage and static checks are independent of the unit tests, it would be better to separate them from the normal build process to speed up the pipeline. I agree that the configs are repeated a lot. It is possible to write composite steps in Github actions so that we can reuse them in multiple jobs though. https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action. I can implement it in this PR or put it in a different PR, depending on how high you want to prioritize it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
