From 0fefc278b57945cecc2abbd9e145b8fd2be8c9bb Mon Sep 17 00:00:00 2001 From: Tyler Gregg Date: Wed, 24 Apr 2024 13:47:27 -0700 Subject: [PATCH] Revert "Use CodeBuild-hosted runners for perf testing and automated publishing (#801)" This reverts commit 9d7e1241188838cd543b0b53962efbb58bcc4e68. --- ...n-java-performance-regression-detector.yml | 28 +++------------ .../workflows/publish-release-artifacts.yml | 30 ++++++++++------ build.gradle.kts | 34 ++++--------------- src/main/java/com/amazon/ion/Span.java | 17 ++++++++-- 4 files changed, 45 insertions(+), 64 deletions(-) diff --git a/.github/workflows/ion-java-performance-regression-detector.yml b/.github/workflows/ion-java-performance-regression-detector.yml index cc0b4114e4..586b4fb406 100644 --- a/.github/workflows/ion-java-performance-regression-detector.yml +++ b/.github/workflows/ion-java-performance-regression-detector.yml @@ -46,30 +46,10 @@ jobs: name: ${{env.test_data_id}} path: testData - select-runner-type: - # If you want to use codebuild runners for your personal fork, follow the instructions to set - # up a codebuild project. https://docs.aws.amazon.com/codebuild/latest/userguide/action-runner.html - # Then, create a repository variable for your fork named `CODEBUILD_PROJECT_NAME` with the name - # of the project you created. - name: Select Runner Type - runs-on: ubuntu-latest - # We want to run on external PRs, but not on internal ones as push automatically builds - # H/T: https://github.com/Dart-Code/Dart-Code/commit/612732d5879730608baa9622bf7f5e5b7b51ae65 - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'amazon-ion/ion-java' - env: - use-codebuild: ${{ vars.CODEBUILD_PROJECT_NAME != '' || github.repository_owner == 'amazon-ion' }} - codebuild-project-name: ${{ vars.CODEBUILD_PROJECT_NAME != '' && vars.CODEBUILD_PROJECT_NAME || 'ion-java' }} - al2-arm: "codebuild-${{ vars.CODEBUILD_PROJECT_NAME != '' && vars.CODEBUILD_PROJECT_NAME || 'ion-java' }}-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large" - outputs: - runner-type: ${{ env.use-codebuild && env.al2_arm || 'ubuntu-latest' }} - steps: - - name: Dump Config - run: echo '${{ toJSON(env) }}' - detect-regression: name: Detect Regression - runs-on: ${{ needs.select-runner-type.outputs.runner-type }} - needs: [ generate-test-data, select-runner-type ] + runs-on: ubuntu-latest + needs: generate-test-data strategy: matrix: test-data: ['nestedStruct', 'nestedList', 'sexp', 'realWorldDataSchema01', 'realWorldDataSchema02', 'realWorldDataSchema03'] @@ -77,11 +57,11 @@ jobs: fail-fast: false steps: - - name: Set up JDK 17 + - name: Set up JDK 11 uses: actions/setup-java@v4.2.1 with: distribution: 'corretto' - java-version: 17 + java-version: 11 - name: Checkout ion-java-benchmark-cli uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index a4b76e2469..fd4ba6816f 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -25,16 +25,11 @@ permissions: contents: read jobs: - publish-to-github-release: - # only run if `check-tag` completes successfully - needs: check-tag - runs-on: "codebuild-ion-java-${{ github.run_id }}-${{ github.run_attempt }}-arm-3.0-large" - permissions: - contents: write + check-tag: + # First, a sanity check to ensure that the library version matches the release version + runs-on: ubuntu-latest steps: - - uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v3.6.0 - with: - submodules: recursive + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v3.6.0 - name: Validate project version matches tag shell: bash run: | @@ -44,9 +39,21 @@ jobs: echo "Project Version: $PROJECT_VERSION" echo "Release Tag: $RELEASE_TAG" [ "$PROJECT_VERSION" = "$RELEASE_TAG" ] || exit 1 - - uses: gradle/gradle-build-action@e2097ccd7e8ed48671dc068ac4efa86d25745b39 # v3.3.1 + publish-to-github-release: + # only run if `check-tag` completes successfully + needs: check-tag + runs-on: ubuntu-latest + permissions: + contents: write + steps: + # TODO: replace with artifact upload/download -- make sure there's no race condition with other builds also + # uploading an artifact. + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v3.6.0 + with: + submodules: recursive + - uses: gradle/gradle-build-action@8baac4c8ef753599f92eeb509c246d09d6250fa6 # v3.3.0 with: - arguments: build cyclonedxBom publishToSonatype closeAndReleaseSonatypeStagingRepository + arguments: build cyclonedxBom - name: Upload Jar to GitHub release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -57,3 +64,4 @@ jobs: run: | gh release upload "v$(