-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNG-7339] Verify Maven can build itself
Closes #613.
- Loading branch information
1 parent
3a06530
commit 16dd31a
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# 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: Can Maven build itself | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
java: [8, 11, 17] | ||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
|
||
- name: Build with Maven | ||
run: mvn verify -e -B -V -DdistributionFileName=apache-maven | ||
|
||
- name: Extract tarball | ||
shell: bash | ||
run: | | ||
set +e | ||
if [ -f ${{ env.TAR_BALL }} ]; then | ||
temp_dir=$(mktemp -d) | ||
tar -xzf ${{ env.TAR_BALL }} -C "$temp_dir" --strip 1 | ||
maven_bin_dir=$temp_dir/bin | ||
if [ -d $maven_bin_dir ]; then | ||
echo "tar.gz file \"${{ env.TAR_BALL }}\" succesfully extracted in temporarily directory \"$temp_dir.\"" | ||
echo "TEMP_MAVEN_BIN_DIR=$maven_bin_dir" >> $GITHUB_ENV | ||
else | ||
echo "$maven_bin_dir does not exist." | ||
exit 1; | ||
fi | ||
else | ||
echo "${{ env.TAR_BALL }} does not exist." | ||
exit 1; | ||
fi | ||
env: | ||
TAR_BALL: apache-maven/target/apache-maven-bin.tar.gz | ||
|
||
- name: Clean with Maven | ||
run: mvn clean | ||
|
||
- name: Build again with Maven SNAPSHOT | ||
shell: bash | ||
run: | | ||
set +e | ||
export PATH=${{ env.TEMP_MAVEN_BIN_DIR }}:$PATH | ||
mvn verify -e -B -V -DdistributionFileName=apache-maven |