Skip to content

fix: add env var for message refiner release notes (#3115) #2413

fix: add env var for message refiner release notes (#3115)

fix: add env var for message refiner release notes (#3115) #2413

name: Test ecr-viewer Container
on:
pull_request:
branches:
- "**"
paths:
- containers/ecr-viewer/**
- containers/fhir-converter/**
merge_group:
types:
- checks_requested
push:
branches:
- main
paths-ignore:
- pyproject.toml
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CONTAINER: ecr-viewer
NODE_VERSION: 18 # Adjust the Node.js version as needed
jobs:
javascript-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint javascript for ${{env.CONTAINER}}
working-directory: ./containers/${{env.CONTAINER}}
run: |
npm ci
npm run lint
test-node-containers:
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: ./containers/${{env.CONTAINER}}
run: npm install
- name: Run tests
working-directory: ./containers/${{env.CONTAINER}}
run: npm test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ env.CONTAINER }}
lighthouse:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Start app
run: CONFIG_NAME=AWS_SQLSERVER_NON_INTEGRATED docker compose --profile AWS_SQLSERVER_NON_INTEGRATED --profile ecr-viewer up -d
working-directory: ./containers/${{env.CONTAINER}}
- name: Wait for Application to be ready
run: |
until curl --output /dev/null --silent --head --fail http://localhost:3000/ecr-viewer; do
printf '.'
sleep 5
done
# - name: Run Lighthouse
# uses: treosh/lighthouse-ci-action@v12
# with:
# configPath: "./lighthouserc.yaml"
# uploadArtifacts: true
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build ${{ env.CONTAINER }} Container
uses: docker/build-push-action@v3
with:
context: ./containers/${{ env.CONTAINER }}
file: ./containers/${{ env.CONTAINER }}/Dockerfile
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
convert-data:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Set up env vars
run: npm run setup-local-env
working-directory: ./containers/${{env.CONTAINER}}
- name: Run seed data conversion
run: npm run convert-seed-data
working-directory: ./containers/${{env.CONTAINER}}
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 30
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: ./containers/${{env.CONTAINER}}
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Set up env vars
working-directory: ./containers/${{env.CONTAINER}}
run: npm run setup-local-env
- name: Run seed data conversion
working-directory: ./containers/${{env.CONTAINER}}
run: npm run convert-seed-data
- name: Run Playwright tests
working-directory: ./containers/${{env.CONTAINER}}
run: npm run test:e2e
- name: Upload playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: containers/${{env.CONTAINER}}/playwright-report/
retention-days: 30
- name: Get docker logs
if: ${{ !cancelled() }}
working-directory: ./containers/${{env.CONTAINER}}/e2e
shell: bash
run: |
echo "Saving $container logs"
docker compose --profile "*" logs --timestamps >& e2e-run.log
- name: Archive docker logs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: logs
path: ./containers/${{env.CONTAINER}}/e2e/e2e-run.log
retention-days: 30