From 14cec5296a759cbc238e7e2cc5d925e4300ad9d6 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Wed, 11 Dec 2024 23:04:35 +0300 Subject: [PATCH 1/2] (chore) Cache install dependencies step in e2e workflow Makes it so that the `Install dependencies` step in the `run-e2e-on-other-repos` job is cached. Without caching, this step takes a full 2 minutes to run for Patient Chart. The commit also adds working-directory directives to keep the cache keys specific to the active repo. Additionally, these changes makes artifact names and steps more explicit by adding the repo name to both the artifact name and step name. --- .github/workflows/e2e.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1d209cf20..4ba18f58a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -144,6 +144,7 @@ jobs: - name: ๐Ÿ“ฆ Install dependencies if: steps.cache-dependencies.outputs.cache-hit != 'true' run: yarn install --immutable + working-directory: e2e_repo - name: ๐Ÿš€ Setup local cache server for Turborepo uses: felixmosh/turborepo-gh-artifacts@v3 @@ -164,33 +165,41 @@ jobs: ref: main path: e2e_repo - - name: ๐Ÿ“„ Copy test environment variables + - name: ๐Ÿ“„ Copy test environment variables for ${{ matrix.repo }} run: cp example.env .env working-directory: e2e_repo - - name: ๐Ÿ“ฆ Install dependencies + - name: ๐Ÿ’พ Cache dependencies for ${{ matrix.repo }} + id: cache-other-repo-dependencies + uses: actions/cache@v4 + with: + path: '**/node_modules' + key: ${{ runner.os }}-${{ hashFiles('e2e_repo/**/yarn.lock') }} + + - name: ๐Ÿ“ฆ Install dependencies for ${{ matrix.repo }} + if: steps.cache-other-repo-dependencies.outputs.cache-hit != 'true' run: yarn install --immutable working-directory: e2e_repo - - name: ๐Ÿ’พ Cache Playwright Browsers + - name: ๐Ÿ’พ Cache Playwright Browsers for ${{ matrix.repo }} id: playwright-cache uses: actions/cache@v4 with: path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-playwright-${{ hashFiles('e2e_repo/**/yarn.lock') }} - - name: ๐ŸŽญ Install Playwright Browsers + - name: ๐ŸŽญ Install Playwright Browsers for ${{ matrix.repo }} run: yarn playwright install --with-deps working-directory: e2e_repo - name: โณ Wait for the OpenMRS instance to start run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done - - name: ๐Ÿงช Run E2E tests + - name: ๐Ÿงช Run E2E tests for ${{ matrix.repo }} run: yarn playwright test working-directory: e2e_repo - - name: ๐Ÿ“ค Upload Report + - name: ๐Ÿ“ค Upload Report for ${{ matrix.repo }} uses: actions/upload-artifact@v4 if: always() with: From 9faf4e6f0f9b9008596ad8516cd6ba8bfa3ea898 Mon Sep 17 00:00:00 2001 From: Dennis Kigen Date: Wed, 11 Dec 2024 23:10:03 +0300 Subject: [PATCH 2/2] Commit orphaned doc updates --- packages/framework/esm-framework/docs/API.md | 2 +- .../framework/esm-framework/docs/interfaces/FetchError.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/framework/esm-framework/docs/API.md b/packages/framework/esm-framework/docs/API.md index 98b197ba9..422e357b3 100644 --- a/packages/framework/esm-framework/docs/API.md +++ b/packages/framework/esm-framework/docs/API.md @@ -2855,7 +2855,7 @@ To cancel the network request, simply call `subscription.unsubscribe();` #### Defined in -[packages/framework/esm-api/src/openmrs-fetch.ts:263](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L263) +[packages/framework/esm-api/src/openmrs-fetch.ts:271](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L271) ___ diff --git a/packages/framework/esm-framework/docs/interfaces/FetchError.md b/packages/framework/esm-framework/docs/interfaces/FetchError.md index a86e44edf..e759d2053 100644 --- a/packages/framework/esm-framework/docs/interfaces/FetchError.md +++ b/packages/framework/esm-framework/docs/interfaces/FetchError.md @@ -21,7 +21,7 @@ #### Defined in -[packages/framework/esm-api/src/openmrs-fetch.ts:328](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L328) +[packages/framework/esm-api/src/openmrs-fetch.ts:336](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L336) ___ @@ -31,4 +31,4 @@ ___ #### Defined in -[packages/framework/esm-api/src/openmrs-fetch.ts:329](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L329) +[packages/framework/esm-api/src/openmrs-fetch.ts:337](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-api/src/openmrs-fetch.ts#L337)