-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* rename e2e on staging deploy action * add e2e for deploy action
- Loading branch information
1 parent
f382e36
commit a3c598a
Showing
3 changed files
with
129 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,21 @@ on: | |
branches: [ main ] | ||
|
||
jobs: | ||
get-e2e-files: | ||
runs-on: ubuntu-24.04 | ||
outputs: | ||
file_list: ${{ steps.generate-file-list.outputs.file_list }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate file list | ||
id: generate-file-list | ||
run: | | ||
FILES=$(ls frontend/cypress/e2e | jq -R . | jq -s . | jq -c) | ||
echo $FILES | ||
echo "file_list=$FILES" >> $GITHUB_OUTPUT | ||
update-version: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-24.04 | ||
|
@@ -47,6 +62,10 @@ jobs: | |
build-docker-image: | ||
needs: update-version | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
file: ${{ fromJSON(needs.get-e2e-files.outputs.file_list) }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -92,62 +111,49 @@ 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 \ | ||
# -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 | ||
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: Run keyloak server | ||
run: cd docker && docker compose up -d keycloak-pitc | ||
|
||
- name: run Springboot okr application | ||
run: | | ||
docker run --network=host \ | ||
-e SPRING_PROFILES_ACTIVE=integration-test \ | ||
${{ needs.read-version.outputs.okr-docker-image}} & | ||
- name: Cypress run e2e tests | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
build: npm i -D cypress | ||
working-directory: frontend | ||
install: false | ||
wait-on: 'http://pitc.okr.localhost:8080/config, http://localhost:8544' | ||
wait-on-timeout: 120 | ||
browser: chrome | ||
headed: false | ||
config: baseUrl=http://pitc.okr.localhost:8080 | ||
spec: cypress/e2e/${{ matrix.file }} | ||
|
||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: cypress-screenshots ${{ matrix.file }} | ||
path: frontend/cypress/screenshots | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
|
@@ -157,7 +163,7 @@ jobs: | |
|
||
upload-to-quay: | ||
runs-on: ubuntu-latest | ||
needs: [update-version, build-docker-image] #[e2e-docker, update-version] | ||
needs: [update-version, e2e-docker] #[e2e-docker, update-version] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|