-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Inder00/feature/github-actions-ci
Github CI build
- Loading branch information
Showing
1 changed file
with
30 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,30 @@ | ||
name: Java CI with Maven | ||
on: [push, pull_request] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [8, 11, 16] | ||
name: Build on JDK ${{ matrix.java }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '${{ matrix.java }}' | ||
distribution: 'adopt' | ||
- name: Cache the Maven packages to speed up build | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build with Maven | ||
run: mvn -B clean package --file pom.xml | ||
- name: Create artifact | ||
uses: 'actions/upload-artifact@v2' | ||
with: | ||
name: "${{ github.sha }}-JDK${{ matrix.java }}" | ||
path: '${{ GITHUB.WORKSPACE }}/target/mineEconomy-*.jar' | ||
if-no-files-found: error |