Initializing My Queries page frontend when user queries present #513
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: | |
- "**" | |
merge_group: | |
types: | |
- checks_requested | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
NODE_VERSION: 18 # Adjust the Node.js version as needed | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run linting | |
working-directory: ./query-connector | |
run: | | |
npm ci | |
npm run lint | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{env.NODE_VERSION}} | |
- name: Install dependencies | |
working-directory: ./query-connector | |
run: npm install | |
- name: Run tests | |
working-directory: ./query-connector | |
run: npm test | |
end-to-end-tests: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{env.NODE_VERSION}} | |
- name: Install dependencies | |
working-directory: ./query-connector | |
run: npm ci | |
- name: Install Playwright Browsers | |
working-directory: ./query-connector | |
run: npx playwright install --with-deps | |
- name: Build Query Connector | |
working-directory: ./query-connector | |
run: docker compose build --no-cache | |
- name: Run Query Connector | |
working-directory: ./query-connector | |
run: docker compose -f ./docker-compose-e2e.yaml up -d | |
- name: Poll until Query Connector is ready | |
run: | | |
until curl -s http://localhost:3000/query-connector; do | |
echo "Waiting for Query Connector to be ready before running Playwright..." | |
sleep 5 | |
done | |
- name: Poll until HAPI server is ready | |
run: | | |
until response=$(curl -v -s -w "HTTP_STATUS:%{http_code}" http://localhost:8080/fhir/Patient); do | |
# Extract status code from the response | |
http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F: '{print $2}') | |
echo "Waiting for HAPI server to be ready..." | |
echo "Response code: $http_status" | |
echo "Full response: $response" | |
sleep 5 | |
done | |
- name: Poll until FHIR server has data | |
run: | | |
until curl -s http://localhost:8080/fhir/Patient | jq '.entry | length > 0' | grep -q 'true'; do | |
echo "Waiting for FHIR server to have data..." | |
sleep 5 | |
done | |
- name: Playwright Tests | |
working-directory: ./query-connector | |
run: npx playwright test e2e --reporter=list --config playwright.config.ts | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: test-results | |
path: ./query-connector/test-results/ |