From a59cb5ae6df26c9dca7dc4998a154ef873c1da87 Mon Sep 17 00:00:00 2001 From: BlazingTwist Date: Fri, 1 Nov 2024 19:52:25 +0100 Subject: [PATCH] create GitHub actions for pushes and pull requests to master (probably won't work first try) --- .github/workflows/maven-publish.yml | 33 +++++++++++++++++++++++++++++ .github/workflows/maven-test.yml | 29 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/maven-publish.yml create mode 100644 .github/workflows/maven-test.yml diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml new file mode 100644 index 00000000..7e5c3afb --- /dev/null +++ b/.github/workflows/maven-publish.yml @@ -0,0 +1,33 @@ +# Package and Upload a release.zip +# See https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven + +name: Publish release + +on: + push: + branches: [ "master" ] + # Allows you to manually run the workflow (for testing) + workflow_dispatch: + +jobs: + build: + name: Build and package Aya + runs-on: ubuntu-latest + permissions: + checks: write + contents: read + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + - name: Run install phase + run: mvn install --batch-mode + - name: Publish the artifact + uses: actions/upload-artifact@v4 + with: + name: aya.zip + path: target/aya-*.zip \ No newline at end of file diff --git a/.github/workflows/maven-test.yml b/.github/workflows/maven-test.yml new file mode 100644 index 00000000..563b5fc7 --- /dev/null +++ b/.github/workflows/maven-test.yml @@ -0,0 +1,29 @@ +# Run the Maven 'test' phase whenever a pull request is opened +# See https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven + +name: Run Maven tests + +on: + pull_request: + branches: [ "master" ] + # Allows you to manually run the workflow (for testing) + workflow_dispatch: + +jobs: + build: + name: Build and run tests + runs-on: ubuntu-latest + permissions: + # allows this workflow to create check runs (their passing/failure is shown on the PR) + checks: write + contents: read + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'temurin' + cache: maven + - name: Run test phase + run: mvn test --batch-mode \ No newline at end of file