Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/build-and-test-on-pr-events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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: Pull Request Build and Test Workflow

# Run this workflow every time a new pull request is created in the repository
on:
push:
branches:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this workflow will also be triggered when pushing to these branches. Is this the intended behavior? Or you want it to be triggered only on pull request?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I do intend to trigger this workflow whenever those branches are updated (a PR is merged to it or someone force push to it).

If we do not include the push event here, will the workflow be trigger when we merge a PR to any of those branches?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, then you may want to change the name / description here:

"name: Pull Request Build and Test Workflow

Run this workflow every time a new pull request is created in the repository"

It looks like it will just happen during a PR creation.
Otherwise all look good to me.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for triggering the test workflow upon push events?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation is that when we need to force-push to a branch, we hope to trigger this workflow too.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, we should never allow force push to an official branch such as 2.4-li.
Assuming there are no force-pushes, then it seems we don't need to trigger CI on regular push events.
I'd suggest we remove these, what do you think?

# Push events on the 2.4-li branch
- '2.4-li'
# Push events on the 2.4-li-dev-* branch
- '2.4-li-dev-*'
pull_request:
types: [opened, reopened, edited, synchronize]
Comment thread
Lincong marked this conversation as resolved.
Outdated

jobs:
build:
# Name the Job
name: Build Pull Request
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
# bring in all history because the gradle versions plugin needs to "walk back" to the closest ancestor tag
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# exclude the streams test and connect test
run: ./gradlew cleanTest :clients:test :core:test --no-daemon -PxmlFindBugsReport=true -PtestLoggingEvents=started,passed,skipped,failed
Comment thread
Lincong marked this conversation as resolved.
Outdated