Skip to content

Commit

Permalink
Move frontend test to ec2 runner. (#4562)
Browse files Browse the repository at this point in the history
* Move frontend test to run on ec2-runner.
  • Loading branch information
davinchia committed Jul 6, 2021
1 parent c83b134 commit b39670d
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,34 @@ jobs:
ec2-instance-id: ${{ needs.start-build-runner.outputs.ec2-instance-id }}

## Frontend Test
frontend-test:
## Gradle Build
# In case of self-hosted EC2 errors, remove this block.
start-frontend-test-runner:
name: Start Frontend Test EC2 Runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Start EC2 Runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
ec2-image-id: ami-04bd6e81239f4f3fb
ec2-instance-type: c5.2xlarge
subnet-id: subnet-0469a9e68a379c1d3
security-group-id: sg-0793f3c9413f21970
frontend-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: Run Frontend Test
steps:
- name: Checkout Airbyte
Expand All @@ -189,11 +215,36 @@ jobs:
- name: Install Pyenv
run: python3 -m pip install virtualenv==16.7.9 --user

- name: Install Cypress Test Dependencies
run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

- name: Build Core Docker Images and Run Tests
run: CORE_ONLY=true ./gradlew --no-daemon composeBuild --scan

- name: Run End-to-End Frontend Tests
run: ./tools/bin/e2e_test.sh
# In case of self-hosted EC2 errors, remove this block.
stop-frontend-test-runner:
name: Stop Frontend Test EC2 Runner
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
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }}
label: ${{ needs.start-frontend-test-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-frontend-test-runner.outputs.ec2-instance-id }}

## Kube Acceptance Tests
# In case of self-hosted EC2 errors, remove this block.
Expand Down

0 comments on commit b39670d

Please sign in to comment.