@@ -105,104 +105,110 @@ jobs:
105105 - name : Run unit tests
106106 run : yarn test:all
107107
108- # # TODO: Re-enable kernel-e2e later
109108 test-kernel-e2e :
110109 runs-on : ubuntu-latest
111110 needs : build
112111 steps :
113112 - name : Checkout
114113 uses : actions/checkout@v4
115- # - uses: ./.github/actions/setup_yarn
116-
117- # - name: Download Canton
118- # run: yarn script:fetch:canton
119-
120- # - name: Start Canton
121- # run: |
122- # set -e
123- # timeout 5m bash -c '
124- # LOGFILE=canton_start.log
125- # yarn start:canton > "$LOGFILE" 2>&1 &
126- # pid=$!
127- # for i in {1..60}; do
128- # if grep -q "Bootstrap script successfully executed." "$LOGFILE"; then
129- # echo "Canton started successfully."
130- # exit 0
131- # fi
132- # if ! kill -0 $pid 2>/dev/null; then
133- # echo "Canton process exited unexpectedly."
134- # cat "$LOGFILE"
135- # exit 1
136- # fi
137- # sleep 5
138- # done
139- # echo "Timeout: 'Bootstrap script successfully executed.' not found in 5 minutes."
140- # cat "$LOGFILE"
141- # exit 1
142- # '
143-
144- # - name: Start remote WK
145- # run: yarn nx run @canton-network/wallet-gateway-remote:start &
146-
147- # - run: yarn nx run @canton-network/example-ping:dev &
148-
149- # - run: yarn nx run @canton-network/mock-oauth2:start &
150-
151- # # Figures out the version of playwright that's installed.
152- # # 1. Because we don't know what version yarn will resolve it to, we have
153- # # to use `yarn why` to get the actually installed version.
154- # # 2. Because we're in a workspace, we need to make sure we get the version
155- # # for the root and not any children, hence the `grep`. If not using
156- # # workspaces, this can be skipped.
157- # # 3. jq comes pre-installed in the Ubuntu runner, so we use that to get
158- # # the correct version string.
159- # # 4. Finally, we use sed to extract just the version number (eg; '1.22.0')
160- # # The result is stored in steps.playwright-version.outputs.version
161- # - name: Get installed Playwright version
162- # id: playwright-version
163- # run: echo "::set-output name=version::$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')"
164-
165- # # Attempt to restore the correct Playwright browser binaries based on the
166- # # currently installed version of Playwright (The browser binary versions
167- # # may change with Playwright versions).
168- # # Note: Playwright's cache directory is hard coded because that's what it
169- # # says to do in the docs. There doesn't appear to be a command that prints
170- # # it out for us.
171- # - name: Load Playwright browser cache
172- # uses: actions/cache@v4
173- # id: playwright-cache
174- # with:
175- # path: '~/.cache/ms-playwright'
176- # key: '${{ runner.os }}-0-playwright-${{ steps.playwright-version.outputs.version }}'
177- # # As a fallback, if the Playwright version has changed, try use the
178- # # most recently cached version. There's a good chance that at least one
179- # # of the browser binary versions haven't been updated, so Playwright can
180- # # skip installing that in the next step.
181- # # Note: When falling back to an old cache, `cache-hit` (used below)
182- # # will be `false`. This allows us to restore the potentially out of
183- # # date cache, but still let Playwright decide if it needs to download
184- # # new binaries or not.
185- # restore-keys: |
186- # ${{ runner.os }}-0-playwright-
187-
188- # # If the Playwright browser binaries weren't able to be restored, we tell
189- # # playwright to install everything for us.
190- # - name: Install Playwright's dependencies
191- # if: steps.playwright-cache.outputs.cache-hit != 'true'
192- # run: yarn workspace @canton-network/example-ping run playwright install --with-deps
193-
194- # - name: Build project
195- # run: yarn build:all
196-
197- # - name: Run example e2e
198- # run: yarn nx playwright:e2e @canton-network/example-ping
199-
200- # - uses: actions/upload-artifact@v4
201- # if: ${{ !cancelled() }}
202- # with:
203- # name: playwright-report
204- # path: examples/ping/playwright-report/
205- # retention-days: 30
114+ - uses : ./.github/actions/setup_yarn
115+
116+ - name : Download Canton
117+ run : yarn script:fetch:canton
118+
119+ - name : Start Canton
120+ run : |
121+ set -e
122+ timeout 5m bash -c '
123+ LOGFILE=canton_start.log
124+ yarn start:canton > "$LOGFILE" 2>&1 &
125+ pid=$!
126+ for i in {1..60}; do
127+ if grep -q "Bootstrap script successfully executed." "$LOGFILE"; then
128+ echo "Canton started successfully."
129+ exit 0
130+ fi
131+ if ! kill -0 $pid 2>/dev/null; then
132+ echo "Canton process exited unexpectedly."
133+ cat "$LOGFILE"
134+ exit 1
135+ fi
136+ sleep 5
137+ done
138+ echo "Timeout: 'Bootstrap script successfully executed.' not found in 5 minutes."
139+ cat "$LOGFILE"
140+ exit 1
141+ '
142+
143+ - name : Start remote WK
144+ run : yarn nx run @canton-network/wallet-gateway-remote:start &
145+
146+ - run : yarn nx run @canton-network/example-ping:dev > "example-ping.log" 2>&1 &
147+
148+ - run : yarn nx run @canton-network/mock-oauth2:start &
149+
150+ # Figures out the version of playwright that's installed.
151+ # 1. Because we don't know what version yarn will resolve it to, we have
152+ # to use `yarn why` to get the actually installed version.
153+ # 2. Because we're in a workspace, we need to make sure we get the version
154+ # for the root and not any children, hence the `grep`. If not using
155+ # workspaces, this can be skipped.
156+ # 3. jq comes pre-installed in the Ubuntu runner, so we use that to get
157+ # the correct version string.
158+ # 4. Finally, we use sed to extract just the version number (eg; '1.22.0')
159+ # The result is stored in steps.playwright-version.outputs.version
160+ - name : Get installed Playwright version
161+ id : playwright-version
162+ run : echo "::set-output name=version::$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')"
163+
164+ # Attempt to restore the correct Playwright browser binaries based on the
165+ # currently installed version of Playwright (The browser binary versions
166+ # may change with Playwright versions).
167+ # Note: Playwright's cache directory is hard coded because that's what it
168+ # says to do in the docs. There doesn't appear to be a command that prints
169+ # it out for us.
170+ - name : Load Playwright browser cache
171+ uses : actions/cache@v4
172+ id : playwright-cache
173+ with :
174+ path : ' ~/.cache/ms-playwright'
175+ key : ' ${{ runner.os }}-0-playwright-${{ steps.playwright-version.outputs.version }}'
176+ # As a fallback, if the Playwright version has changed, try use the
177+ # most recently cached version. There's a good chance that at least one
178+ # of the browser binary versions haven't been updated, so Playwright can
179+ # skip installing that in the next step.
180+ # Note: When falling back to an old cache, `cache-hit` (used below)
181+ # will be `false`. This allows us to restore the potentially out of
182+ # date cache, but still let Playwright decide if it needs to download
183+ # new binaries or not.
184+ restore-keys : |
185+ ${{ runner.os }}-0-playwright-
186+
187+ # If the Playwright browser binaries weren't able to be restored, we tell
188+ # playwright to install everything for us.
189+ - name : Install Playwright's dependencies
190+ if : steps.playwright-cache.outputs.cache-hit != 'true'
191+ run : yarn workspace @canton-network/example-ping run playwright install --with-deps
192+
193+ - name : Build project
194+ run : yarn build:all
195+
196+ - name : Run example e2e
197+ run : yarn nx playwright:e2e @canton-network/example-ping
198+
199+ - uses : actions/upload-artifact@v4
200+ if : ${{ !cancelled() }}
201+ with :
202+ name : playwright-report
203+ path : examples/ping/playwright-report/
204+ retention-days : 5
205+
206+ - uses : actions/upload-artifact@v4
207+ if : ${{ failure() }}
208+ with :
209+ name : example-ping-logs
210+ path : example-ping.log
211+ retention-days : 5
206212
207213 sdk-e2e :
208214 name : sdk-e2e (${{ matrix.network }})
0 commit comments