diff options
Diffstat (limited to '.github/workflows/test-mixed-versions.yaml')
-rw-r--r-- | .github/workflows/test-mixed-versions.yaml | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/.github/workflows/test-mixed-versions.yaml b/.github/workflows/test-mixed-versions.yaml index b64fe01831..5d4e68334d 100644 --- a/.github/workflows/test-mixed-versions.yaml +++ b/.github/workflows/test-mixed-versions.yaml @@ -28,9 +28,100 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: + ensure-mixed-version-archive: + name: Prepare Artifacts + runs-on: ubuntu-latest + env: + # otp-min + otp_version_id: 25_0 + steps: + - name: CHECKOUT REPOSITORY + uses: actions/checkout@v3 + with: + path: primary-umbrella + #! - name: Setup tmate session + #! uses: mxschmitt/action-tmate@v3 + - name: CHECK FOR ARCHIVE ON S3 + id: check + working-directory: primary-umbrella + run: | + set -u + + ARCHIVE_URL="$(grep -Eo 'https://rabbitmq-github-actions.s3.eu-west-1.amazonaws.com.*.tar.xz' bazel/bzlmod/secondary_umbrella.bzl)" + echo "ARCHIVE_URL: ${ARCHIVE_URL}" + + curl -LO "${ARCHIVE_URL}" + + if xzcat --test package-generic-unix-for-mixed-version-testing-v*.tar.xz; then + exists=true + else + exists=false + fi + echo "exists=${exists}" | tee $GITHUB_ENV + + VERSION=${ARCHIVE_URL#*package-generic-unix-for-mixed-version-testing-v} + VERSION=${VERSION%*.tar.xz} + echo "version=${VERSION}" | tee $GITHUB_OUTPUT + - name: CHECKOUT REPOSITORY (MIXED VERSION) + if: env.exists != 'true' + uses: actions/checkout@v3 + with: + ref: v${{ steps.check.outputs.version }} + path: secondary-umbrella + - name: MOUNT BAZEL CACHE + if: env.exists != 'true' + uses: actions/cache@v3.0.11 + with: + path: "/home/runner/repo-cache/" + key: repo-cache-secondary-umbrella + - name: BUILD SECONDARY UMBRELLA ARCHIVE + if: env.exists != 'true' + working-directory: secondary-umbrella + run: | + if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then + cat << EOF >> user.bazelrc + build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} + EOF + fi + cat << EOF >> user.bazelrc + build:buildbuddy --build_metadata=ROLE=CI + build:buildbuddy --build_metadata=VISIBILITY=PRIVATE + build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-secondary-umbrella + build:buildbuddy --repository_cache=/home/runner/repo-cache/ + build:buildbuddy --color=yes + build:buildbuddy --disk_cache= + + build:buildbuddy --remote_download_toplevel + EOF + + sed -i"_orig" -E "/APP_VERSION/ s/3\.[0-9]+\.[0-9]+/${{ steps.check.outputs.version }}/" rabbitmq.bzl + bazelisk build :package-generic-unix \ + --config=rbe-${{ env.otp_version_id }} \ + --test_build \ + --verbose_failures + + OUTPUT_DIR=${{ github.workspace }}/output + mkdir ${OUTPUT_DIR} + cp \ + bazel-bin/package-generic-unix.tar.xz \ + ${OUTPUT_DIR}/package-generic-unix-for-mixed-version-testing-v${{ steps.check.outputs.version }}.tar.xz + - name: UPLOAD THE ARCHIVE TO S3 + if: env.exists != 'true' + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --follow-symlinks + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}} + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_REGION: ${{ secrets.AWS_REGION }} + SOURCE_DIR: output + DEST_DIR: secondary-umbrellas + test-mixed-versions: name: Test (Mixed Version Cluster) runs-on: ubuntu-latest + needs: ensure-mixed-version-archive strategy: fail-fast: false matrix: @@ -73,6 +164,7 @@ jobs: test-exclusive-mixed-versions: name: Test (Exclusive Tests with Mixed Version Cluster) runs-on: ubuntu-latest + needs: ensure-mixed-version-archive strategy: matrix: include: |