Skip to content

Commit

Permalink
Adds run_mvn action
Browse files Browse the repository at this point in the history
  • Loading branch information
XComp committed Dec 21, 2023
1 parent 6451916 commit e9905bc
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 12 deletions.
39 changes: 39 additions & 0 deletions .github/actions/run_mvn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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: "Runs Maven Command"
description: "Sets the Java version within Flink' CI Docker container"
inputs:
working-directory:
description: "The directory under which the Maven command should be executed."
default: "${{ github.workspace }}"
maven-parameters:
description: "Any parameters of the Maven command."
default: ""
env:
description: "Any environment-specifics that are meant to be available in the context of the call."
default: ""
runs:
using: "composite"
steps:
- name: "Runs Maven Command"
working-directory: "${{ inputs.working-directory }}"
shell: bash
run: |
source "./tools/ci/maven-utils.sh"
${{ inputs.env }} run_mvn ${{ inputs.maven-parameters }}
16 changes: 9 additions & 7 deletions .github/workflows/template.flink-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ jobs:
target-directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}

- name: "Compile Flink"
working-directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
run: |
${{ inputs.environment }} run_mvn test-compile -Dflink.markBundledAsOptional=false -Dfast
uses: "./.github/actions/run_mvn"
with:
working-directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
maven-parameter: "test-compile -Dflink.markBundledAsOptional=false -Dfast"
env: "${{ inputs.environment }}"

- name: "Collect build artifacts"
working-directory: ${{ env.CONTAINER_LOCAL_WORKING_DIR }}
Expand Down Expand Up @@ -365,9 +367,6 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: "Loads Maven environment"
run: source ./tools/ci/maven-utils.sh

- name: "Download build artifacts from compile job"
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -410,7 +409,10 @@ jobs:
run: ./tools/azure-pipelines/cache_docker_images.sh load

- name: "Build Flink"
run: ${{ inputs.environment }} run_mvn install -DskipTests -Dfast $PROFILE -Pskip-webui-build
uses: "./.github/actions/run_mvn"
with:
maven-parameter: "install -DskipTests -Dfast $PROFILE -Pskip-webui-build"
env: "${{ inputs.environment }}"

- name: "Run E2E Tests"
id: test-run
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/template.pre-compile-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,22 @@ jobs:
- name: "Loads Maven environment"
run: source ./tools/ci/maven-utils.sh

- name: "Codestyle"
run: |
run_mvn checkstyle:check spotless:check -T1C
- name: "Checkstyle"
uses: "./.github/actions/run_mvn"
with:
maven-parameter: "checkstyle:check -T1C"

- name: "Spotless"
if: (success() || failure())
uses: "./.github/actions/run_mvn"
with:
maven-parameter: "spotless:check -T1C"

- name: "License Headers"
if: (success() || failure())
run: |
run_mvn org.apache.rat:apache-rat-plugin:check -N
uses: "./.github/actions/run_mvn"
with:
maven-parameter: "org.apache.rat:apache-rat-plugin:check -N"

docs-404-check:
name: "Docs 404 Check"
Expand Down

0 comments on commit e9905bc

Please sign in to comment.