From 88692e14e197dc846c0c1d185a48a34e4994cdd4 Mon Sep 17 00:00:00 2001 From: Lonyin Chan Date: Thu, 7 Nov 2024 16:17:11 +0000 Subject: [PATCH] actions --- .github/workflows/build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..51f9577 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +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 \ No newline at end of file