From a01363234cf1a555e5ae27dd2707c13eb3988ce3 Mon Sep 17 00:00:00 2001 From: krahets Date: Fri, 17 Nov 2023 01:11:13 +0800 Subject: [PATCH] Add auto-build-and-check workflow for Java. --- .github/workflows/java.yml | 29 +++++++++++++++++++++++++++++ codes/java/.gitignore | 1 + 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/java.yml create mode 100644 codes/java/.gitignore diff --git a/.github/workflows/java.yml b/.github/workflows/java.yml new file mode 100644 index 000000000..233b4292b --- /dev/null +++ b/.github/workflows/java.yml @@ -0,0 +1,29 @@ +# # This workflow will install OpenJDK and build the Java project +# For more information see: https://github.com/actions/setup-java + +name: Java + +on: + push: + branches: [ "main" ] + paths: ["codes/java/**/*.java"] + pull_request: + branches: [ "main" ] + paths: ["codes/java/**/*.java"] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + java: [ '11', '17' ] + name: Java ${{ matrix.Java }} sample + steps: + - uses: actions/checkout@v4 + - name: Setup java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + - run: javac -d codes/java/build codes/java/**/*.java diff --git a/codes/java/.gitignore b/codes/java/.gitignore new file mode 100644 index 000000000..c795b054e --- /dev/null +++ b/codes/java/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file