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
name: Java Apps - Run Tests and Package | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
test_and_build: | |
name: Test and build samples | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK | |
uses: actions/checout@v3 | |
with: | |
java-version: '11' | |
distribution: 'termurin' | |
- name: run tests | |
run: mvn clean test | tee test.log | |
- name: build artifacts | |
run: mvn clean package -Dmaven.test.skip | |
- name: set up artifacts | |
run: mkdir artifacts && cp test.log target/*.jar artifacts | |
- uses: actions/upload-artfact@v3 | |
with: | |
name: Package | |
path: artifacts |