Skip to content
Snippets Groups Projects
Unverified Commit e43bf373 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Stop caching uberjar for E2E tests (#35079)

* Stop caching the uberjar for E2E tests

* Bring back SHA1 in an uberjar name

* Adjust the download uberjar action

* Fix uberjar name for percy
parent dc8c63fd
No related branches found
No related tags found
No related merge requests found
name: Download uberjar for E2E tests
description: Download either a freshly built artifact or the one built in one of the previous commits.
name: Find and download uberjar for E2E tests
description: Download previously built artifact from one of the previous commits.
inputs:
edition:
description: Metabase edition.
required: true
was-built:
description: Was the artifact built during the current workflof run?
required: true
runs:
using: "composite"
steps:
- uses: actions/download-artifact@v3
if: ${{ inputs.was-built == 'true' }}
name: Retrieve uberjar artifact for ${{ inputs.edition }}
with:
name: metabase-${{ inputs.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
- name: Download previously stored uberjar
if: ${{ inputs.was-built == 'false' }}
uses: actions/github-script@v6
with:
script: | # js
......@@ -76,7 +66,6 @@ runs:
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: Unzip Metabase artifact containing an uberjar
if: ${{ inputs.was-built == 'false' }}
run: unzip mb.zip
shell: bash
......
name: Prepare Uberjar Artifact
description: Prepare and upload Metabase JAR as a GitHub artifact.
inputs:
name:
required: true
description: Artifact name
runs:
using: "composite"
steps:
......@@ -11,7 +18,7 @@ runs:
- name: Upload JARs as artifact
uses: actions/upload-artifact@v3
with:
name: metabase-${{ matrix.edition }}-uberjar
name: ${{ inputs.name }}
path: |
./target/uberjar/metabase.jar
./COMMIT-ID
......
......@@ -18,7 +18,6 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
e2e_specs: ${{ steps.changes.outputs.e2e_specs }}
e2e_all: ${{ steps.changes.outputs.e2e_all }}
steps:
- uses: actions/checkout@v3
......@@ -67,26 +66,15 @@ jobs:
- name: Build uberjar with ./bin/build.sh
run: ./bin/build.sh
- name: Mark with the commit hash
run: echo ${{ github.sha }} > COMMIT-ID
shell: bash
- name: Calculate SHA256 checksum
run: sha256sum ./target/uberjar/metabase.jar > SHA256.sum
shell: bash
- name: Upload JARs as artifact
uses: actions/upload-artifact@v3
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
name: metabase-${{ matrix.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
path: |
./target/uberjar/metabase.jar
./COMMIT-ID
./SHA256.sum
e2e-tests:
needs: [build, files-changed, e2e-matrix-builder]
needs: [build, e2e-matrix-builder]
if: |
!cancelled() &&
(needs.files-changed.outputs.e2e_specs == 'true' || needs.build.result == 'success')
!cancelled() && needs.build.result == 'success'
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
name: e2e-tests-${{ matrix.name }}-${{ matrix.edition }}
......@@ -111,9 +99,6 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
# Important in case we need to download uberjar from previous commits!
fetch-depth: ${{ needs.build.result == 'success' && '' || 20 }}
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
......@@ -126,14 +111,19 @@ jobs:
mysql: ${{ matrix.name != 'mongo'}}
mongo: ${{ matrix.name == 'mongo'}}
- name: Download Metabase ${{ matrix.edition }} uberjar
uses: ./.github/actions/e2e-download-uberjar
- name: Retrieve uberjar artifact for ${{ matrix.edition }}
uses: actions/download-artifact@v3
with:
edition: ${{ matrix.edition }}
was-built: ${{ needs.build.result == 'success' }}
name: metabase-${{ matrix.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
- name: Get the version info
run: |
jar xf target/uberjar/metabase.jar version.properties
mv version.properties resources/
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
......@@ -211,15 +201,10 @@ jobs:
timeout-minutes: 60
needs: [build]
if: |
!cancelled() &&
(needs.files-changed.outputs.e2e_specs == 'true' || needs.build.result == 'success') &&
github.event_name != 'schedule'
!cancelled() && needs.build.result == 'success'
name: percy-visual-regression-tests
steps:
- uses: actions/checkout@v3
with:
# Important in case we need to download uberjar from previous commits!
fetch-depth: ${{ needs.build.result == 'success' && '' || 20 }}
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
......@@ -228,19 +213,25 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
maildev: true
- name: Download Metabase enterprise uberjar
uses: ./.github/actions/e2e-download-uberjar
- name: Retrieve uberjar artifact for ${{ matrix.edition }}
uses: actions/download-artifact@v3
with:
edition: 'ee'
was-built: ${{ needs.build.result == 'success' }}
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
- name: Get the version info
run: |
jar xf target/uberjar/metabase.jar version.properties
mv version.properties resources/
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
......
......@@ -45,6 +45,8 @@ jobs:
run: ./bin/build.sh
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
check_jar_health:
runs-on: ubuntu-22.04
......@@ -66,7 +68,7 @@ jobs:
- uses: actions/download-artifact@v3
name: Retrieve uberjar artifact
with:
name: metabase-${{ matrix.edition }}-uberjar
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
- name: Launch uberjar
run: java -jar ./target/uberjar/metabase.jar &
- name: Wait for Metabase to start
......@@ -98,7 +100,7 @@ jobs:
- name: Download uploaded artifacts to insert into container
uses: actions/download-artifact@v3
with:
name: metabase-${{ matrix.edition }}-uberjar
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
path: bin/docker/
- name: Move the ${{ matrix.edition }} uberjar to the context dir
run: mv bin/docker/target/uberjar/metabase.jar bin/docker/.
......@@ -216,7 +218,7 @@ jobs:
- name: Download uploaded artifacts to insert into container
uses: actions/download-artifact@v3
with:
name: metabase-${{ matrix.edition }}-uberjar
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
path: bin/docker/
- name: Move the ${{ matrix.edition }} uberjar to the context dir
run: mv bin/docker/target/uberjar/metabase.jar bin/docker/.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment