-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (48 loc) · 1.66 KB
/
fhirscan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: FHIR Scan
on:
pull_request:
paths:
- .github/workflows/fhirscan.yml
workflow_dispatch:
jobs:
fhirscan:
name: run fhir scan
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: main
- name: Checkout bdt repo
uses: actions/checkout@v4
with:
repository: smart-on-fhir/bdt
path: my-tools
- uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: ${{ vars.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/delegatedadmin/developer/bcda-test-github-actions
- name: Get database credentials
uses: cmsgov/ab2d-bcda-dpc-platform/actions/aws-params-env-action@main
env:
AWS_REGION: ${{ vars.AWS_REGION }}
with:
params: |
CLIENT_ID=/bcda/dev/api/DEV_CLIENT_ID
CLIENT_SECRET=/bcda/dev/api/DEV_CLIENT_SECRET
- name: Run BDT
id: run
run: |
echo "Running FHIR scan against https://dev.bcda.cms.gov"
ls
docker build --no-cache -t bdt -f ./Dockerfiles/Dockerfile.bdt .
docker rm -f bdt || echo "BDT container already cleaned up."
docker run --name bdt -e BASE_URL="https://dev.bcda.cms.gov" -e CLIENT_ID="$CLIENT_ID" -e SECRET="$CLIENT_SECRET" bdt 2>&1
RESULT=$(docker logs bdt --tail 6 | grep -o "failed tests: [0-9]*" | cut -d ' ' -f3)
docker rm -f bdt || echo "BDT container already cleaned up."
if [[ $RESULT -eq 0 ]]; then
exit 0
else
exit 1
fi
- uses: actions/checkout@v3