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 cypress in docker #1390

Merged
merged 15 commits into from
Jul 12, 2024
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
context: .
file: bindings/grpc/Dockerfile
push: false
labels: iotaledger/identity-grpc:latest
tags: iotaledger/identity-grpc:latest
98 changes: 97 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,105 @@ jobs:
uses: './.github/actions/iota-sandbox/setup'

- name: Run Wasm examples
run: npm run test:examples
run: npm run test:readme && npm run test:node
working-directory: bindings/wasm

- name: Tear down iota sandbox
if: always()
uses: './.github/actions/iota-sandbox/tear-down'

test-wasm-firefox:
needs: build-wasm
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
include:
- os: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm

- name: Download bindings/wasm artifacts
uses: actions/download-artifact@v2
with:
name: identity-wasm-bindings-build
path: bindings/wasm

- name: Start iota sandbox
uses: './.github/actions/iota-sandbox/setup'

- name: Build Docker image
uses: docker/build-push-action@v6.2.0
with:
context: bindings/wasm/
file: bindings/wasm/cypress/Dockerfile
push: false
tags: cypress-test:latest
load: true

- name: Run cypress
run: docker run --network host cypress-test test:browser:parallel:firefox

- name: Tear down iota sandbox
if: always()
uses: './.github/actions/iota-sandbox/tear-down'

test-wasm-chrome:
needs: build-wasm
if: ${{ needs.check-for-run-condition.outputs.should-run == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
include:
- os: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x

- name: Install JS dependencies
run: npm ci
working-directory: bindings/wasm

- name: Download bindings/wasm artifacts
uses: actions/download-artifact@v2
with:
name: identity-wasm-bindings-build
path: bindings/wasm

- name: Start iota sandbox
uses: './.github/actions/iota-sandbox/setup'

- name: Build Docker image
uses: docker/build-push-action@v6.2.0
with:
context: bindings/wasm/
file: bindings/wasm/cypress/Dockerfile
push: false
tags: cypress-test:latest
load: true

- name: Run cypress
run: docker run --network host cypress-test test:browser:parallel:chrome

- name: Tear down iota sandbox
if: always()
uses: './.github/actions/iota-sandbox/tear-down'
2 changes: 2 additions & 0 deletions bindings/wasm/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
target
11 changes: 11 additions & 0 deletions bindings/wasm/cypress/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM cypress/browsers:latest

COPY ./ /e2e

WORKDIR /e2e

RUN npm ci

RUN npm run build:examples:web

ENTRYPOINT [ "npm", "run" ]
Loading
Loading