Skip to content

Commit

Permalink
Implement html structure and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Nov 6, 2024
1 parent 57e60ce commit 202a29c
Show file tree
Hide file tree
Showing 108 changed files with 2,625 additions and 1,993 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backend-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Use Maven to run unittests and integration tests
run: mvn clean verify
run: mvn clean verify -X
4 changes: 2 additions & 2 deletions .github/workflows/demo-deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Set up node 18
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Set up node 18
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/format-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.17.1
node-version: 22.10.0

- name: Npm install
run: npm ci
Expand Down Expand Up @@ -46,10 +46,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'
server-id: github
settings-path: ${{github.workspace}}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/frontend-test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.17.1
node-version: ${{vars.NODE_VERSION}}

- name: Npm install
run: npm ci
Expand All @@ -28,10 +28,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- uses: abhi1693/[email protected]
Expand All @@ -43,11 +43,11 @@ jobs:
run: |
docker run -d \
--name my_keycloak \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=keycloak \
-e KC_BOOTSTRAP_ADMIN_USERNAME=admin26 \
-e KC_BOOTSTRAP_ADMIN_PASSWORD=keycloak26 \
-v ./docker/config/realm-export-pitc.json:/opt/keycloak/data/import/realm-pitc.json \
-p 8544:8080 \
quay.io/keycloak/keycloak:24.0.2 \
quay.io/keycloak/keycloak:26.0.1 \
start-dev --import-realm
- name: start backend
Expand All @@ -70,4 +70,4 @@ jobs:
path: frontend/cypress/screenshots

- name: remove docker containers
run: docker ps -aq | xargs -r docker rm -f
run: docker ps -aq | xargs -r docker rm -f
136 changes: 70 additions & 66 deletions .github/workflows/staging-deploy-action.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: 'Staging-Deploy'

on:
# pull_request:
# types:
# - closed
# branches: [ main ]
pull_request:
types:
- closed
branches: [ main ]

jobs:
update-version:
Expand Down Expand Up @@ -50,16 +50,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
- name: Set up JDK ${{vars.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: ${{vars.JAVA_VERSION}}
distribution: 'adopt'

- name: Set up node 18
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 18.17.1
node-version: ${{vars.NODE_VERSION}}

- name: Install Dependencies
run: cd ./frontend && npm ci
Expand Down Expand Up @@ -92,68 +92,72 @@ jobs:
- name: print imagetags
run: echo ${{ needs.update-version.outputs.okr-docker-image}}

e2e-docker:
runs-on: ubuntu-24.04
needs: [build-docker-image,update-version]
steps:
- uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: okr-image
path: /tmp

- name: Load image
run: docker load --input /tmp/okr-docker-image.tar

- name: show images
run: docker image ls -a

- name: Run docker image
run: |
docker run --network=host \
-p 8080:8080 \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER-URI=http://localhost:8544/realms/pitc \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK-SET-URI=http://localhost:8544/realms/pitc/protocol/openid-connect/certs \
-e SPRING_SECURITY_OAUTH2_RESOURCESERVER_OPAQUETOKEN_CLIENT-ID=pitc_okr_staging \
-e SPRING_PROFILES_ACTIVE-ID=integration-test \
-e SPRING_DATASOURCE_URL="jdbc:h2:mem:db;DB_CLOSE_DELAY=-1" \
-e SPRING_DATASOURCE_USERNAME=user \
-e SPRING_DATASOURCE_PASSWORD=sa \
-e SPRING_FLYWAY_LOCATIONS="classpath:db/h2-db/database-h2-schema,classpath:db/h2-db/data-test-h2" \
${{ needs.update-version.outputs.okr-docker-image}} &
- name: run keycloak docker
run: |
docker run \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=keycloak \
-v ./docker/config/realm-export.json:/opt/keycloak/data/import/realm.json \
-p 8544:8080 \
quay.io/keycloak/keycloak:23.0.1 \
start-dev --import-realm &
- uses: abhi1693/[email protected]
with:
browser: chrome
version: latest

- name: Cypress run e2e tests
uses: cypress-io/github-action@v6
# e2e-docker:
# runs-on: ubuntu-24.04
# needs: [build-docker-image,update-version]
# steps:
# - uses: actions/checkout@v4
#
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: okr-image
# path: /tmp
#
# - name: Load image
# run: docker load --input /tmp/okr-docker-image.tar
#
# - name: show images
# run: docker image ls -a
#
# - name: Run docker image
# run: |
# docker run --network=host \
# -e SPRING_PROFILES_ACTIVE=integration-test \
# ${{ needs.update-version.outputs.okr-docker-image}} &
#
# - name: run keycloak docker
# run: |
# docker run \
# -e KEYCLOAK_ADMIN=admin \
# -e KEYCLOAK_ADMIN_PASSWORD=keycloak \
# -v ./docker/config/realm-export.json:/opt/keycloak/data/import/realm.json \
# -p 8544:8080 \
# quay.io/keycloak/keycloak:23.0.1 \
# start-dev --import-realm &
#
# - uses: abhi1693/[email protected]
# with:
# browser: chrome
# version: latest
#
# - name: Cypress run e2e tests
# uses: cypress-io/github-action@v6
# with:
# build: npm i -D cypress
# install: false
# wait-on: 'http://pitc.okr.localhost:8080/config, http://localhost:8544'
# wait-on-timeout: 120
# browser: chrome
# headed: true
# working-directory: frontend
# config: baseUrl=http://pitc.okr.localhost:8080
#
# - uses: actions/upload-artifact@v4
# if: always()
# with:
# name: cypress-screenshots
# path: frontend/cypress/screenshots

- uses: actions/upload-artifact@v4
if: always()
with:
build: npm i -D cypress
install: false
wait-on: 'http://localhost:8080/config, http://localhost:8544'
wait-on-timeout: 120
browser: chrome
headed: true
working-directory: frontend
config: baseUrl=http://localhost:8080
name: cypress-screenshots
path: frontend/cypress/screenshots

upload-to-quay:
runs-on: ubuntu-latest
needs: [e2e-docker, update-version]
needs: [update-version, build-docker-image] #[e2e-docker, update-version]
steps:
- uses: actions/checkout@v4

Expand Down
17 changes: 17 additions & 0 deletions .run/OkrApplication-debug-docker.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

<component name="ProjectRunConfigurationManager">
<configuration default="false" name="OkrApplication Debug Docker" type="Remote">
<module name="OkrApplication" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="5005" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>
17 changes: 17 additions & 0 deletions .run/OkrApplication-local-prod-debug.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

<component name="ProjectRunConfigurationManager">
<configuration default="false" name="OkrApplication Local-prod debug" type="Remote">
<module name="exam-feedback-tool" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="5005" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>
Loading

0 comments on commit 202a29c

Please sign in to comment.