Skip to content

Commit

Permalink
Merge branch 'develop' into update/OH2-388-mutate-exam-with-rows
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Oct 23, 2024
2 parents 25e6cd6 + f35d659 commit e8b7709
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,27 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Checkout core
run: git clone --depth=50 --branch=develop https://github.com/informatici/openhospital-core.git openhospital-core

- name: Determine PR source branch
id: extract_branch
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF:-develop}" >> $GITHUB_ENV

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
java-package: jdk

- name: Checkout core
run: |
git clone --depth=50 https://github.com/informatici/openhospital-core.git openhospital-core
cd openhospital-core
git fetch origin ${{ env.BRANCH_NAME }} || git fetch origin develop
git checkout ${{ env.BRANCH_NAME }} || git checkout develop
cd ..
- name: Install core
run: cd openhospital-core && mvn install -DskipTests=true && cd ..

- name: Build with Maven
run: mvn install -DskipTests=true
26 changes: 12 additions & 14 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
with:
persist-credentials: false

- name: Checkout core
run: git clone --depth=50 --branch=develop https://github.com/informatici/openhospital-core.git openhospital-core
- name: Determine PR source branch
id: extract_branch
run: echo "BRANCH_NAME=${GITHUB_HEAD_REF:-develop}" >> $GITHUB_ENV

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -27,38 +28,35 @@ jobs:
java-version: 17
java-package: jdk

- name: Checkout core
run: |
git clone --depth=50 https://github.com/informatici/openhospital-core.git openhospital-core
cd openhospital-core
git fetch origin ${{ env.BRANCH_NAME }} || git fetch origin develop
git checkout ${{ env.BRANCH_NAME }} || git checkout develop
cd ..
- name: Install core
run: cd openhospital-core && mvn install -DskipTests=true && cd ..

- name: Generate JWT Token
id: jwt
run: echo "token=7DlyD1SHR5pCa4HGgTLWSYm8YQ7oRL1wpPbxyjWyHU44vUrqrooRu3lHVFSXWChesc" >> $GITHUB_OUTPUT

- name: Store branch name
id: extract_branch
run: |
if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then
echo "branch=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
echo "branch=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_OUTPUT
else
echo "branch=INVALID_EVENT_BRANCH_UNKNOWN" >> $GITHUB_OUTPUT
fi
- name: Build with Maven
run: |
cp rsc/database.properties.dist rsc/database.properties
cp rsc/log4j2-spring.properties.dist rsc/log4j2-spring.properties
cp rsc/settings.properties.dist rsc/settings.properties
sed -e "s/JWT_TOKEN_SECRET/${{ steps.jwt.outputs.token }}/g" -e "s/API_HOST/localhost/g" -e "s/API_PORT/8080/g" rsc/application.properties.dist > rsc/application.properties
mvn install -DskipTests=true
echo ${{ steps.extract_branch.outputs.branch }}
- name: Run API
run: |
cd target
java -cp "openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.launch.JarLauncher &
sleep 60
cd ..
- name: Generate OpenAPI yaml
run: mvn springdoc-openapi:generate -Dspringdoc.outputFileName=oh_rev.yaml
Expand Down

0 comments on commit e8b7709

Please sign in to comment.