diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a37d15a4..43a8c4415 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,11 @@ on: types: - created +env: + TURBO_API: 'http://127.0.0.1:9080' + TURBO_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }} + TURBO_TEAM: ${{ github.repository_owner }} + jobs: build: runs-on: ubuntu-latest @@ -21,7 +26,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: "18" - + - name: Cache dependencies id: cache uses: actions/cache@v3 @@ -30,7 +35,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - name: Set yarn version run: yarn set version berry - + - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install @@ -40,16 +45,16 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} server-token: ${{ secrets.TURBO_SERVER_TOKEN }} - + - name: Run tests run: yarn run test - + - name: Run lint and typechecking - run: yarn run verify - + run: yarn run verify + - name: Run build - run: yarn turbo run build --color --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team="${{ github.repository_owner }}" - + run: yarn turbo run build --color" + - name: Upload build artifacts uses: actions/upload-artifact@v2 with: @@ -73,10 +78,10 @@ jobs: steps: - name: Download Artifacts uses: actions/download-artifact@v2 - + - name: Compute Timestamp run: echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - + - name: Prepare Directory shell: bash run: | @@ -99,10 +104,10 @@ jobs: steps: - name: Download Artifacts uses: actions/download-artifact@v2 - + - name: Compute Timestamp run: echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - + - name: Prepare Directory shell: bash run: | @@ -124,14 +129,14 @@ jobs: with: node-version: 18 registry-url: "https://registry.npmjs.org" - + - name: Cache dependencies id: cache uses: actions/cache@v3 with: path: '**/node_modules' key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - + - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npx lerna bootstrap @@ -141,10 +146,10 @@ jobs: - name: Patch run: yarn lerna version patch --no-git-tag-version --no-push --yes - + - name: Version run: npx lerna version "$(node -e "console.log(require('./lerna.json').version)")-pre.${{ github.run_number }}" --no-git-tag-version --yes - + - run: git config user.email "info@thepalladiumgroup.com" && git config user.name "KenyaEMR CI" - run: git add . && git commit -m "Prerelease version" --no-verify @@ -156,7 +161,7 @@ jobs: shell: bash run: | ls -alh - + release: runs-on: ubuntu-latest @@ -172,21 +177,21 @@ jobs: with: node-version: "16" registry-url: "https://registry.npmjs.org" - + - name: Cache dependencies id: cache uses: actions/cache@v3 with: path: '**/node_modules' key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} - + - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true' run: npx lerna bootstrap - + - name: Build run: yarn turbo run build --color - + - name: Publish run: yarn run ci:publish env: diff --git a/e2e/README.md b/e2e/README.md index 4d479b699..32a0d90c3 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -1,43 +1,45 @@ # E2E Tests This directory contains an E2E test suite using the [Playwright](https://playwright.dev) -framework. +framework. ## Getting Started -Please ensure that you have followed the basic installation guide in the -[root README](../README.md). -Once everything is set up, make sure the dev server is running by using: +Please ensure that you have followed the basic installation guide in the [root README](../README.md). Once everything is set up, make sure the dev server is running by using: ```sh yarn start ``` + Then, in a separate terminal, run: ```sh yarn test-e2e --headed ``` -By default, the test suite will run against the http://localhost:8080. -You can override this by exporting `E2E_BASE_URL` environment variables beforehand: +By default, the test suite will run against the http://localhost:8080. You can override this by exporting `E2E_BASE_URL` environment variables beforehand: ```sh # Ex: Set the server URL to dev3: export E2E_BASE_URL=https://dev3.openmrs.org/openmrs # Run all e2e tests: + +```sh yarn test-e2e --headed ``` + To run a specific test by title: + ```sh yarn test-e2e --headed -g "title of the test" ``` + Check [this documentation](https://playwright.dev/docs/running-tests#command-line) for more running options. It is also highly recommended to install the companion VS Code extension: https://playwright.dev/docs/getting-started-vscode - ## Writing New Tests In general, it is recommended to read through the official [Playwright docs](https://playwright.dev/docs/intro) @@ -92,8 +94,8 @@ This is very much underdeveloped/WIP. At the moment, there exists a (git-shared) file which can be used for configuring certain test attributes. This is most likely about to change in the future. Stay tuned for updates! +## Github Actions integration -## Github Action integration The e2e.yml workflow is made up of two jobs: one for running on pull requests (PRs) and one for running on commits.