Skip to content

Add initial phase of CPT implementation #407

Add initial phase of CPT implementation

Add initial phase of CPT implementation #407

on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- master
pull_request:
jobs:
Build-Docker-Image:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Cache terminology files
uses: actions/cache@v2
with:
path: ~/terminology
key: terminology-${{ github.sha }}
restore-keys: terminology-
- name: Setup MySQL
run: |
docker network create gh
docker run \
--network gh \
--name mysql \
-e MYSQL_ROOT_PASSWORD=test \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=test \
-e MYSQL_DATABASE=test \
-d mysql:8
- name: Docker Build
run: |
docker build \
--tag fhirserver \
.
- name: Scan Code
run: |
docker run --entrypoint /work/fhirserver/utilities/codescan/codescan fhirserver /work/bootstrap
- name: Prepare ini file
env:
FHIRSERVER_LOCATIONS_CLONE_PATH: /work/fhirserver
FHIRSERVER_LOCATIONS_TEST_CASES_CLONE_PATH: /work/bootstrap/source/fhir-test-cases
FHIRSERVER_LOCATIONS_MARKDOWN_CLONE_PATH: /work/bootstrap/source/delphi-markdown
FHIRSERVER_LOCATIONS_SNOMED_CACHE_PATH: /terminology/fhir-server/snomed.test.cache
FHIRSERVER_MYSQL_SERVER: mysql
FHIRSERVER_EMAIL_SENDER: fhir-server@healthintersections.com.au
FHIRSERVER_EMAIL_DESTINATION: fhirservertests@gmail.com
FHIRSERVER_EMAIL_PASSWORD: ${{ secrets.FHIRSERVER_EMAIL_PASSWORD }}
FHIRSERVER_SSL_CERT_PATH: /work/fhirserver/fixtures/domain.crt
FHIRSERVER_SSL_KEY_PATH: /work/fhirserver/fixtures/domain.key
FHIRSERVER_SSL_CACERT_PATH: /work/fhirserver/fixtures/rootCA.crt
FHIRSERVER_SSL_PASSWORD: password
run: |
cat fixtures/test-settings.ini.template | envsubst > ~/test-settings.ini
- name: Ensure SNOMED cache is present
run: |
mkdir -p ~/terminology/fhir-server
wget -q --no-clobber https://storage.googleapis.com/ig-build/snomed.test.cache -O ~/terminology/fhir-server/snomed.test.cache || true
ls ~/terminology/fhir-server/snomed.test.cache
- name: Run tests in docker
run: |
docker images --all
docker run \
--network gh \
-v ~/terminology:/terminology \
-v ~/test-settings.ini:/work/fhirserver/exec/64/test-settings.ini \
fhirserver -tests
- name: Tag and push Docker image
run: |
docker tag fhirserver ${{ secrets.DOCKERHUB_USERNAME }}/fhirserver:latest
docker push ${{ secrets.DOCKERHUB_USERNAME }}/fhirserver:latest