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

run e2e test in github actions #1004

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
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
71 changes: 71 additions & 0 deletions .github/workflows/e2e-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: e2e test Build, Test & Coverage
on: # yamllint disable-line rule:truthy
pull_request:
paths:
- 'indexer/**'
- 'e2e-testing/**'
- 'protocol/**'
push:
branches:
- main
- 'wl/**' # e.g. wl/test
paths:
- 'indexer/**'
- 'e2e-testing/**'
- 'protocol/**'

# Ensure only a single instance of this workflow is running, and cancel any that are in-progress
# before this workflow instance starts
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


jobs:
setup:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./e2e-testing

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install pnpm
run:
npm install -g [email protected]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installation of pnpm is done globally, which is acceptable, but the version is hardcoded. Consider using a variable or a strategy to manage the version to make updates easier in the future.

- npm install -g [email protected]
+ npm install -g pnpm@${{ env.PNPM_VERSION }}

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- name: Install pnpm
run:
npm install -g pnpm@6.34.0
- name: Install pnpm
run:
npm install -g pnpm@${{ env.PNPM_VERSION }}


- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and install Indexer
run: |
pnpm install --loglevel warn --frozen-lockfile
pnpm run build:all
working-directory: ./indexer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Build and install Indexer' step has a misaligned run keyword, which will cause a syntax error in the YAML file. This needs to be corrected for the workflow to function.

-        run: |
+      run: |

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- name: Build and install Indexer
run: |
pnpm install --loglevel warn --frozen-lockfile
pnpm run build:all
working-directory: ./indexer
- name: Build and install Indexer
run: |
pnpm install --loglevel warn --frozen-lockfile
pnpm run build:all
working-directory: ./indexer


- name: Build and Start Docker Compose
run: |
cd ../protocol
make e2etest-build-image
cd ../e2e-testing
docker compose -f docker-compose-e2e-test.yml up -d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Build and Start Docker Compose' step correctly builds the Docker image and starts the services using Docker Compose. However, the use of cd to change directories is not necessary and can be replaced with the working-directory option for consistency.

-        cd ../protocol
-        make e2etest-build-image
-        cd ../e2e-testing
-        docker compose -f docker-compose-e2e-test.yml up -d
+      run: make e2etest-build-image
+      working-directory: ./protocol
+      run: docker compose -f docker-compose-e2e-test.yml up -d
+      working-directory: ./e2e-testing

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
- name: Build and Start Docker Compose
run: |
cd ../protocol
make e2etest-build-image
cd ../e2e-testing
docker compose -f docker-compose-e2e-test.yml up -d
- name: Build and Start Docker Compose
run: make e2etest-build-image
working-directory: ./protocol
run: docker compose -f docker-compose-e2e-test.yml up -d
working-directory: ./e2e-testing


build_and_test:
needs: setup
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./e2e-testing

steps:
- name: Build and Test
run: |
pnpm build
pnpm test