Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build FE on FE changes #11422

Merged
merged 9 commits into from
Mar 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 51 additions & 12 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ jobs:

## Frontend Test
# In case of self-hosted EC2 errors, remove this block.
start-frontend-test-runner:
name: "Frontend: Start Test EC2 Runner"
start-frontend-runner:
name: "Frontend: Start EC2 Runner"
needs: changes
# Because scheduled builds on master require us to skip the changes job. Use always() to force this to run on master.
if: |
Expand All @@ -292,10 +292,48 @@ jobs:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
frontend-build:
name: "Frontend: Build"
needs: start-frontend-runner
runs-on: ${{ needs.start-frontend-runner.outputs.label }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2

- name: Cache Build Artifacts
uses: ./.github/actions/cache-build-artifacts
with:
cache-key: ${{ secrets.CACHE_VERSION }}
cache-python: "false"

- uses: actions/setup-java@v1
with:
java-version: "17"

- uses: actions/setup-node@v1
with:
node-version: "16.13.0"

- name: Set up CI Gradle Properties
run: |
mkdir -p ~/.gradle/
cat > ~/.gradle/gradle.properties <<EOF
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=8
org.gradle.vfs.watch=false
EOF

- name: Build :airbyte-webapp
run: SUB_BUILD=PLATFORM ./gradlew --no-daemon :airbyte-webapp:build --scan
frontend-test:
name: "Frontend: Run Test"
needs: start-frontend-test-runner # required to start the main job when the runner is ready
runs-on: ${{ needs.start-frontend-test-runner.outputs.label }} # run the job on the newly created runner
name: "Frontend: Run End-to-End Tests"
needs:
- start-frontend-runner # required to have runner started
runs-on: ${{ needs.start-frontend-runner.outputs.label }} # run the job on the newly created runner
timeout-minutes: 120
steps:
- name: Checkout Airbyte
Expand Down Expand Up @@ -336,16 +374,17 @@ jobs:
CYPRESS_WEBAPP_KEY: ${{ secrets.CYPRESS_WEBAPP_KEY }}
run: ./tools/bin/e2e_test.sh
# In case of self-hosted EC2 errors, remove this block.
stop-frontend-test-runner:
name: "Frontend: Stop Test Runner"
stop-frontend-runner:
name: "Frontend: Stop Runner"
timeout-minutes: 10
needs:
- start-frontend-test-runner # required to get output from the start-runner job
- frontend-test # required to wait when the main job is done
- start-frontend-runner # required to get output from the start-runner job
- frontend-test # required to wait when the e2e-test job is done
- frontend-build # required to wait when then build job is done
runs-on: ubuntu-latest
# Always is required to stop the runner even if the previous job has errors. However always() runs even if the previous step is skipped.
# Thus, we check for skipped here.
if: ${{ always() && needs.start-frontend-test-runner.result != 'skipped'}}
if: ${{ always() && needs.start-frontend-runner.result != 'skipped'}}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand All @@ -358,8 +397,8 @@ jobs:
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }}
label: ${{ needs.start-frontend-test-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-test-runner.outputs.ec2-instance-id }}
label: ${{ needs.start-frontend-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-runner.outputs.ec2-instance-id }}

## FOLLOWING BUILDS ARE ALL PLATFORM BUILDS.

Expand Down