From f21d28fa3539ba9c847e3f8078496050757b052f Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Fri, 30 Jun 2023 23:59:50 +0200 Subject: [PATCH 01/10] e2e testing initial --- .github/workflows/e2e-testing.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/e2e-testing.yml diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml new file mode 100644 index 0000000000..ebbb01a43c --- /dev/null +++ b/.github/workflows/e2e-testing.yml @@ -0,0 +1,44 @@ +name: End to End Testing + +on: workflow_call + +jobs: + e2e-testing: + + name: End to End Testing + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3.11.0 + with: + distribution: 'adopt' + java-version: '17' + java-package: jdk + architecture: x64 + + - name: Download latest paper + run: | + VERSION=$(curl -s https://api.papermc.io/v2/projects/paper | jq '.versions[-1]' -r) + BUILD_JAR=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds" | jq '.builds[-1] | "\(.build) \(.downloads.application.name)"' -r) + BUILD=$(echo "$BUILD_JAR" | awk '{print $1}') + JAR_FILE=$(echo "$BUILD_JAR" | awk '{print $2}') + curl -o paper.jar "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE" + + - name: Setup server + run: | + echo 'eula=true' > eula.txt + mkdir plugins + + - uses: actions/download-artifact@v3 + with: + name: slimefun-${{ github.event.number }} + path: plugins/ + + - name: Run server + run: | + java -jar paper.jar --nogui From c579d87aeed2532504c9c38a0b65bed4fc337626 Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Sun, 2 Jul 2023 12:09:51 +0100 Subject: [PATCH 02/10] Setup matrix --- .github/workflows/e2e-testing.yml | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index ebbb01a43c..57f021ff99 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -9,6 +9,20 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 + strategy: + matrix: + include: + - mcVersion: '1.16.5' + javaVersion: '16' + - mcVersion: '1.17.1' + javaVersion: '17' + - mcVersion: '1.18.2' + javaVersion: '18' + - mcVersion: '1.19.4' + javaVersion: '19' + - mcVersion: '1.20.1' + javaVersion: '20' + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -16,18 +30,20 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3.11.0 with: - distribution: 'adopt' - java-version: '17' + distribution: temurin + java-version: ${{ matrix.javaVersion }} java-package: jdk architecture: x64 - - name: Download latest paper + - name: Download ${{ matrix.mcVersion }} Paper run: | - VERSION=$(curl -s https://api.papermc.io/v2/projects/paper | jq '.versions[-1]' -r) - BUILD_JAR=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds" | jq '.builds[-1] | "\(.build) \(.downloads.application.name)"' -r) + VERSION="${{ matrix.mcVersion }}" + BUILD_JAR=$(curl -s "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds" \ + | jq '.builds[-1] | "\(.build) \(.downloads.application.name)"' -r) BUILD=$(echo "$BUILD_JAR" | awk '{print $1}') JAR_FILE=$(echo "$BUILD_JAR" | awk '{print $2}') - curl -o paper.jar "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE" + curl -o paper.jar \ + "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE" - name: Setup server run: | From 6d9d0c519688f0e8809c48f561db8493dae73617 Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Tue, 4 Jul 2023 23:48:44 +0100 Subject: [PATCH 03/10] Download tester --- .github/workflows/e2e-testing.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 57f021ff99..192ede827d 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -45,10 +45,14 @@ jobs: curl -o paper.jar \ "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE" + - name: Download e2e-tester + run: curl -o e2e-tester.jar https://preview-builds.walshy.dev/download/e2e-tester/main/latest + - name: Setup server run: | echo 'eula=true' > eula.txt mkdir plugins + mv e2e-tester.jar plugins/e2e-tester.jar - uses: actions/download-artifact@v3 with: From 2f56579bc1552bddfec88bab04705e432a4fafb9 Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Sun, 16 Jul 2023 22:20:49 +0100 Subject: [PATCH 04/10] Jeff's changes --- .github/workflows/e2e-testing.yml | 30 +++++++++++++++++++----------- .github/workflows/pull-request.yml | 12 +++++++++++- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 192ede827d..b4adf613f7 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -1,6 +1,12 @@ name: End to End Testing -on: workflow_call +on: + workflow_call: + inputs: + artifact-name: + description: 'Slimefun artifact name' + required: true + type: string jobs: e2e-testing: @@ -35,6 +41,11 @@ jobs: java-package: jdk architecture: x64 + - name: Setup server + run: | + echo 'eula=true' > eula.txt + mkdir plugins + - name: Download ${{ matrix.mcVersion }} Paper run: | VERSION="${{ matrix.mcVersion }}" @@ -45,20 +56,17 @@ jobs: curl -o paper.jar \ "https://api.papermc.io/v2/projects/paper/versions/$VERSION/builds/$BUILD/downloads/$JAR_FILE" - - name: Download e2e-tester - run: curl -o e2e-tester.jar https://preview-builds.walshy.dev/download/e2e-tester/main/latest + - name: Download Slimefun + uses: actions/download-artifact@v3 + with: + name: ${{ inputs.artifact-name }} + path: plugins/ - - name: Setup server + - name: Download e2e-tester run: | - echo 'eula=true' > eula.txt - mkdir plugins + curl -o e2e-tester.jar https://preview-builds.walshy.dev/download/e2e-tester/main/latest mv e2e-tester.jar plugins/e2e-tester.jar - - uses: actions/download-artifact@v3 - with: - name: slimefun-${{ github.event.number }} - path: plugins/ - - name: Run server run: | java -jar paper.jar --nogui diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2c3a31ab8c..9d8a235ec6 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,6 +14,8 @@ jobs: setup-preview-build: name: Preview build runs-on: ubuntu-latest + outputs: + short-commit-hash: ${{ steps.env-setup.outputs.SHORT_COMMIT_HASH }} steps: - name: Checkout repository @@ -35,10 +37,12 @@ jobs: restore-keys: ${{ runner.os }}-m2 # Setup for the preview build - - run: | + - id: env-setup + run: | SHORT_COMMIT_HASH=$(git rev-parse --short=8 ${{ github.sha }}) JAR_VERSION="Preview Build #${{ github.event.number }}-$SHORT_COMMIT_HASH" echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_ENV" + echo "SHORT_COMMIT_HASH=$SHORT_COMMIT_HASH" >> "$GITHUB_OUTPUT" echo "JAR_VERSION=$JAR_VERSION" >> "$GITHUB_ENV" sed -i "s/4.9-UNOFFICIAL<\/version>/$JAR_VERSION<\/version>/g" pom.xml @@ -50,3 +54,9 @@ jobs: with: name: slimefun-${{ github.event.number }}-${{ env.SHORT_COMMIT_HASH }} path: 'target/Slimefun v${{ env.JAR_VERSION }}.jar' + + call-workflows: + needs: [setup-preview-build] + uses: ./.github/workflows/e2e-testing.yml + with: + artifact-name: slimefun-${{ github.event.number }}-${{ needs.setup-preview-build.outputs.short-commit-hash }} From 8783e7bccaa36a32fbc205b522b6388739361784 Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:20:00 +0100 Subject: [PATCH 05/10] Update .github/workflows/e2e-testing.yml --- .github/workflows/e2e-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index b4adf613f7..8044e9f63a 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -33,7 +33,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v3.11.0 with: distribution: temurin From 65dce9a43acdcb30aabaa013b9e9a198a7eb9bb6 Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:40:32 +0100 Subject: [PATCH 06/10] Update .github/workflows/e2e-testing.yml --- .github/workflows/e2e-testing.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 8044e9f63a..1033765601 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -10,7 +10,6 @@ on: jobs: e2e-testing: - name: End to End Testing runs-on: ubuntu-latest timeout-minutes: 5 From 4a0f76d27538d27dfd7ca7ae59e4bd664c661884 Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:47:19 +0100 Subject: [PATCH 07/10] Update .github/workflows/e2e-testing.yml --- .github/workflows/e2e-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 1033765601..a18b1cf8d4 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -1,4 +1,4 @@ -name: End to End Testing +name: End to End Testings on: workflow_call: From 6b5e7a56dec2e9af6bf9406c2d50adc047694ab4 Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:54:11 +0100 Subject: [PATCH 08/10] Update .github/workflows/e2e-testing.yml --- .github/workflows/e2e-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index a18b1cf8d4..1033765601 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -1,4 +1,4 @@ -name: End to End Testings +name: End to End Testing on: workflow_call: From 6559cfe07d021c26182a22fbc2c386e45207c9a8 Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:00:34 +0100 Subject: [PATCH 09/10] Update .github/workflows/e2e-testing.yml --- .github/workflows/e2e-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 1033765601..4f7d0e1d13 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: artifact-name: - description: 'Slimefun artifact name' + description: 'Slimefun artifact names' required: true type: string From 9b959d96c17f9fa7834116633f045d466079220d Mon Sep 17 00:00:00 2001 From: J3fftw <44972470+J3fftw1@users.noreply.github.com> Date: Wed, 22 Nov 2023 20:05:56 +0100 Subject: [PATCH 10/10] Update .github/workflows/e2e-testing.yml --- .github/workflows/e2e-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-testing.yml b/.github/workflows/e2e-testing.yml index 4f7d0e1d13..1033765601 100644 --- a/.github/workflows/e2e-testing.yml +++ b/.github/workflows/e2e-testing.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: artifact-name: - description: 'Slimefun artifact names' + description: 'Slimefun artifact name' required: true type: string