From b4b39bb441d903da0597e9b626ff18c046935309 Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sun, 18 Feb 2024 15:29:44 -0600 Subject: [PATCH 1/8] pipeline-updates: Java 11 intermittent test failures, try not running in parallel --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 63540cc..c0d2c1a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest strategy: fail-fast: false - max-parallel: 2 + max-parallel: 1 matrix: # build against supported Java LTS versions: java: [ 8, 11, 17, 21 ] From f0289413d6138f6da1beefba412bd3a3a1b4f02d Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sun, 18 Feb 2024 15:45:13 -0600 Subject: [PATCH 2/8] pipeline-updates: Java 11 intermittent fail - try increasing stack size --- .github/workflows/pipeline.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index c0d2c1a..46c1592 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -52,7 +52,12 @@ jobs: java-version: ${{ matrix.java }} cache: 'maven' - name: Compile Java ${{ matrix.java }} - run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true + run: | + if [ "${{ matrix.java }}" = "11" ]; then + MAVEN_OPTS="-Xss4m" mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true + else + mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true + fi - name: Run Tests ${{ matrix.java }} run: | mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} From cd631d970e964f3e42ed0175f7bba4430334740b Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sun, 18 Feb 2024 15:54:29 -0600 Subject: [PATCH 3/8] pipeline-updates: Java 11 intermittent fail - try an earlier release (there is no later release --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 46c1592..edd0057 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -41,7 +41,7 @@ jobs: max-parallel: 1 matrix: # build against supported Java LTS versions: - java: [ 8, 11, 17, 21 ] + java: [ 8, '11.0.21', 17, 21 ] name: Java ${{ matrix.java }} steps: - uses: actions/checkout@v3 From c1107fa987a986dd41a876e7d85c1e82c96e407f Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sun, 18 Feb 2024 16:17:41 -0600 Subject: [PATCH 4/8] pipeline-updates: Java 11 intermittent fail - try separate build --- .github/workflows/pipeline.yml | 61 +++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index edd0057..7350f7a 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -34,14 +34,15 @@ jobs: with: name: Create java 1.6 JAR path: target/*.jar - build: + + build-11: runs-on: ubuntu-latest strategy: fail-fast: false max-parallel: 1 matrix: # build against supported Java LTS versions: - java: [ 8, '11.0.21', 17, 21 ] + java: [ 11 ] name: Java ${{ matrix.java }} steps: - uses: actions/checkout@v3 @@ -52,12 +53,56 @@ jobs: java-version: ${{ matrix.java }} cache: 'maven' - name: Compile Java ${{ matrix.java }} - run: | - if [ "${{ matrix.java }}" = "11" ]; then - MAVEN_OPTS="-Xss4m" mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true - else - mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true - fi + run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true + - name: Run Tests ${{ matrix.java }} + run: | + mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + - name: Build Test Report ${{ matrix.java }} + if: ${{ always() }} + run: | + mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + - name: Upload Test Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Test Results ${{ matrix.java }} + path: target/surefire-reports/ + - name: Upload Test Report ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Test Report ${{ matrix.java }} + path: target/site/ + - name: Package Jar ${{ matrix.java }} + run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true + - name: Upload Package Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Package Jar ${{ matrix.java }} + path: target/*.jar + + + build-matrix: + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 2 + matrix: + # build against supported Java LTS versions: + java: [ 8, 17, 21 ] + name: Java ${{ matrix.java }} + steps: + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + - name: Compile Java ${{ matrix.java }} + run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true - name: Run Tests ${{ matrix.java }} run: | mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} From 8de0628bd11912cbcaf11da566751f6396e096fe Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sat, 2 Mar 2024 08:55:24 -0600 Subject: [PATCH 5/8] pipeline-updates - disable deployment.yml workflow for now (it's not set up in secrets yet) --- .github/workflows/deployment.yml | 153 ++++++++++++++++--------------- 1 file changed, 77 insertions(+), 76 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index e870644..8cda38e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -4,79 +4,80 @@ # * https://github.com/actions/setup-java/blob/v3.13.0/docs/advanced-usage.md#Publishing-using-Apache-Maven # -name: Deployment workflow - -on: - release: - types: [published] - -jobs: - # old-school build and jar method. No tests run or compiled. - publish-1_6: - name: Publish Java 1.6 to GitHub Release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - name: Setup java - uses: actions/setup-java@v1 - with: - java-version: 1.6 - - name: Compile Java 1.6 - run: | - mkdir -p target/classes - javac -version - javac -source 1.6 -target 1.6 -d target/classes/ src/main/java/org/json/*.java - - name: Create JAR 1.6 - run: | - jar cvf "target/org.json-1.6-${{ github.ref_name }}.jar" -C target/classes . - - name: Add 1.6 Jar To Release - uses: softprops/action-gh-release@v1 - with: - append_body: true - files: | - target/*.jar - publish: - name: Publish Java 8 to Maven Central and GitHub Release - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - uses: actions/checkout@v4 - - name: Set up Java for publishing to Maven Central Repository - uses: actions/setup-java@v3 - with: - # Use lowest supported LTS Java version - java-version: '8' - distribution: 'temurin' - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_PASSWORD # env variable for token in deploy - gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import - gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase - - - name: Publish to the Maven Central Repository - run: mvn --batch-mode deploy - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - - name: Add Jar To Release - uses: softprops/action-gh-release@v1 - with: - append_body: true - files: | - target/*.jar - # - name: Set up Java for publishing to GitHub Packages - # uses: actions/setup-java@v3 - # with: - # # Use lowest supported LTS Java version - # java-version: '8' - # distribution: 'temurin' - # - name: Publish to GitHub Packages - # run: mvn --batch-mode deploy - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# COMMENTING OUT UNTIL SECRETS CAN BE ADDED +#name: Deployment workflow +# +#on: +# release: +# types: [published] +# +#jobs: +# # old-school build and jar method. No tests run or compiled. +# publish-1_6: +# name: Publish Java 1.6 to GitHub Release +# runs-on: ubuntu-latest +# permissions: +# contents: write +# steps: +# - uses: actions/checkout@v4 +# - name: Setup java +# uses: actions/setup-java@v1 +# with: +# java-version: 1.6 +# - name: Compile Java 1.6 +# run: | +# mkdir -p target/classes +# javac -version +# javac -source 1.6 -target 1.6 -d target/classes/ src/main/java/org/json/*.java +# - name: Create JAR 1.6 +# run: | +# jar cvf "target/org.json-1.6-${{ github.ref_name }}.jar" -C target/classes . +# - name: Add 1.6 Jar To Release +# uses: softprops/action-gh-release@v1 +# with: +# append_body: true +# files: | +# target/*.jar +# publish: +# name: Publish Java 8 to Maven Central and GitHub Release +# runs-on: ubuntu-latest +# permissions: +# contents: write +# packages: write +# steps: +# - uses: actions/checkout@v4 +# - name: Set up Java for publishing to Maven Central Repository +# uses: actions/setup-java@v3 +# with: +# # Use lowest supported LTS Java version +# java-version: '8' +# distribution: 'temurin' +# server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml +# server-username: MAVEN_USERNAME # env variable for username in deploy +# server-password: MAVEN_PASSWORD # env variable for token in deploy +# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import +# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase +# +# - name: Publish to the Maven Central Repository +# run: mvn --batch-mode deploy +# env: +# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} +# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} +# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} +# +# - name: Add Jar To Release +# uses: softprops/action-gh-release@v1 +# with: +# append_body: true +# files: | +# target/*.jar +# # - name: Set up Java for publishing to GitHub Packages +# # uses: actions/setup-java@v3 +# # with: +# # # Use lowest supported LTS Java version +# # java-version: '8' +# # distribution: 'temurin' +# # - name: Publish to GitHub Packages +# # run: mvn --batch-mode deploy +# # env: +# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 989cdb61bcf46ad8a9d3759ec4c65ed2956330d3 Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sat, 2 Mar 2024 09:15:32 -0600 Subject: [PATCH 6/8] pipeline-updates - do not build in parallel --- .github/workflows/pipeline.yml | 103 +++++++++++++++++++++++++++++++-- 1 file changed, 99 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 7350f7a..bb4cf07 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -35,6 +35,54 @@ jobs: name: Create java 1.6 JAR path: target/*.jar + build-8: + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 1 + matrix: + # build against supported Java LTS versions: + java: [ 8 ] + name: Java ${{ matrix.java }} + steps: + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + - name: Compile Java ${{ matrix.java }} + run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true + - name: Run Tests ${{ matrix.java }} + run: | + mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + - name: Build Test Report ${{ matrix.java }} + if: ${{ always() }} + run: | + mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + - name: Upload Test Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Test Results ${{ matrix.java }} + path: target/surefire-reports/ + - name: Upload Test Report ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Test Report ${{ matrix.java }} + path: target/site/ + - name: Package Jar ${{ matrix.java }} + run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true + - name: Upload Package Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Package Jar ${{ matrix.java }} + path: target/*.jar + build-11: runs-on: ubuntu-latest strategy: @@ -83,15 +131,62 @@ jobs: name: Package Jar ${{ matrix.java }} path: target/*.jar - - build-matrix: + build-17: runs-on: ubuntu-latest strategy: fail-fast: false - max-parallel: 2 + max-parallel: 1 matrix: # build against supported Java LTS versions: - java: [ 8, 17, 21 ] + java: [ 17 ] + name: Java ${{ matrix.java }} + steps: + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + - name: Compile Java ${{ matrix.java }} + run: mvn clean compile -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true -D maven.javadoc.skip=true + - name: Run Tests ${{ matrix.java }} + run: | + mvn test -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + - name: Build Test Report ${{ matrix.java }} + if: ${{ always() }} + run: | + mvn surefire-report:report-only -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + mvn site -D generateReports=false -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} + - name: Upload Test Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Test Results ${{ matrix.java }} + path: target/surefire-reports/ + - name: Upload Test Report ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Test Report ${{ matrix.java }} + path: target/site/ + - name: Package Jar ${{ matrix.java }} + run: mvn clean package -D maven.compiler.source=${{ matrix.java }} -D maven.compiler.target=${{ matrix.java }} -D maven.test.skip=true -D maven.site.skip=true + - name: Upload Package Results ${{ matrix.java }} + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: Package Jar ${{ matrix.java }} + path: target/*.jar + + build-21: + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 1 + matrix: + # build against supported Java LTS versions: + java: [ 21 ] name: Java ${{ matrix.java }} steps: - uses: actions/checkout@v3 From 3eb8a62af614c2507c6027c55414c15c93a197f2 Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sat, 2 Mar 2024 09:57:40 -0600 Subject: [PATCH 7/8] pipeline-updates - space after # char? --- .github/workflows/deployment.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 8cda38e..35a74f5 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -3,15 +3,15 @@ # * https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions # * https://github.com/actions/setup-java/blob/v3.13.0/docs/advanced-usage.md#Publishing-using-Apache-Maven # - +# # COMMENTING OUT UNTIL SECRETS CAN BE ADDED -#name: Deployment workflow +# name: Deployment workflow # -#on: +# on: # release: # types: [published] # -#jobs: +# jobs: # # old-school build and jar method. No tests run or compiled. # publish-1_6: # name: Publish Java 1.6 to GitHub Release From 390d442054c1591c895710d4df8da024dd95fe0a Mon Sep 17 00:00:00 2001 From: Sean Leary Date: Sat, 2 Mar 2024 10:00:13 -0600 Subject: [PATCH 8/8] pipeline-updates - remove deployment.yml for now, will restore after setting up secrets --- .github/workflows/deployment.yml | 83 -------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 .github/workflows/deployment.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml deleted file mode 100644 index 35a74f5..0000000 --- a/.github/workflows/deployment.yml +++ /dev/null @@ -1,83 +0,0 @@ -# For more information see: -# * https://docs.github.com/en/actions/learn-github-actions -# * https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions -# * https://github.com/actions/setup-java/blob/v3.13.0/docs/advanced-usage.md#Publishing-using-Apache-Maven -# -# -# COMMENTING OUT UNTIL SECRETS CAN BE ADDED -# name: Deployment workflow -# -# on: -# release: -# types: [published] -# -# jobs: -# # old-school build and jar method. No tests run or compiled. -# publish-1_6: -# name: Publish Java 1.6 to GitHub Release -# runs-on: ubuntu-latest -# permissions: -# contents: write -# steps: -# - uses: actions/checkout@v4 -# - name: Setup java -# uses: actions/setup-java@v1 -# with: -# java-version: 1.6 -# - name: Compile Java 1.6 -# run: | -# mkdir -p target/classes -# javac -version -# javac -source 1.6 -target 1.6 -d target/classes/ src/main/java/org/json/*.java -# - name: Create JAR 1.6 -# run: | -# jar cvf "target/org.json-1.6-${{ github.ref_name }}.jar" -C target/classes . -# - name: Add 1.6 Jar To Release -# uses: softprops/action-gh-release@v1 -# with: -# append_body: true -# files: | -# target/*.jar -# publish: -# name: Publish Java 8 to Maven Central and GitHub Release -# runs-on: ubuntu-latest -# permissions: -# contents: write -# packages: write -# steps: -# - uses: actions/checkout@v4 -# - name: Set up Java for publishing to Maven Central Repository -# uses: actions/setup-java@v3 -# with: -# # Use lowest supported LTS Java version -# java-version: '8' -# distribution: 'temurin' -# server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml -# server-username: MAVEN_USERNAME # env variable for username in deploy -# server-password: MAVEN_PASSWORD # env variable for token in deploy -# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import -# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase -# -# - name: Publish to the Maven Central Repository -# run: mvn --batch-mode deploy -# env: -# MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} -# MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} -# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} -# -# - name: Add Jar To Release -# uses: softprops/action-gh-release@v1 -# with: -# append_body: true -# files: | -# target/*.jar -# # - name: Set up Java for publishing to GitHub Packages -# # uses: actions/setup-java@v3 -# # with: -# # # Use lowest supported LTS Java version -# # java-version: '8' -# # distribution: 'temurin' -# # - name: Publish to GitHub Packages -# # run: mvn --batch-mode deploy -# # env: -# # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}