Merge pull request #2719 from gradido/resolve-docker-build-dependencies-in-test-workflow

refactor(other): decrease docker build dependencies in test workflow
This commit is contained in:
mahula 2023-02-17 09:22:05 +01:00 committed by GitHub
commit 4b4e008d22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,6 @@ jobs:
locales_frontend: locales_frontend:
name: Locales - Frontend name: Locales - Frontend
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_frontend]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -171,20 +170,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Frontend)
uses: actions/download-artifact@v3
with:
name: docker-frontend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/frontend.tar
##########################################################################
# LOCALES FRONTEND ####################################################### # LOCALES FRONTEND #######################################################
########################################################################## ##########################################################################
- name: Frontend | Locales - name: Frontend | Locales
run: docker run --rm gradido/frontend:test yarn run locales run: cd frontend && yarn && yarn run locales
############################################################################## ##############################################################################
# JOB: LINT FRONTEND ######################################################### # JOB: LINT FRONTEND #########################################################
@ -192,7 +181,6 @@ jobs:
lint_frontend: lint_frontend:
name: Lint - Frontend name: Lint - Frontend
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_frontend]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -200,20 +188,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Frontend)
uses: actions/download-artifact@v3
with:
name: docker-frontend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/frontend.tar
##########################################################################
# LINT FRONTEND ########################################################## # LINT FRONTEND ##########################################################
########################################################################## ##########################################################################
- name: Frontend | Lint - name: Frontend | Lint
run: docker run --rm gradido/frontend:test yarn run lint run: cd frontend && yarn && yarn run lint
############################################################################## ##############################################################################
# JOB: STYLELINT FRONTEND #################################################### # JOB: STYLELINT FRONTEND ####################################################
@ -221,7 +199,6 @@ jobs:
stylelint_frontend: stylelint_frontend:
name: Stylelint - Frontend name: Stylelint - Frontend
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_frontend]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -229,20 +206,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Frontend)
uses: actions/download-artifact@v3
with:
name: docker-frontend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/frontend.tar
##########################################################################
# STYLELINT FRONTEND ##################################################### # STYLELINT FRONTEND #####################################################
########################################################################## ##########################################################################
- name: Frontend | Stylelint - name: Frontend | Stylelint
run: docker run --rm gradido/frontend:test yarn run stylelint run: cd frontend && yarn && yarn run stylelint
############################################################################## ##############################################################################
# JOB: LINT ADMIN INTERFACE ################################################## # JOB: LINT ADMIN INTERFACE ##################################################
@ -250,7 +217,6 @@ jobs:
lint_admin: lint_admin:
name: Lint - Admin Interface name: Lint - Admin Interface
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_admin]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -258,20 +224,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Admin Interface)
uses: actions/download-artifact@v3
with:
name: docker-admin-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/admin.tar
##########################################################################
# LINT ADMIN INTERFACE ################################################### # LINT ADMIN INTERFACE ###################################################
########################################################################## ##########################################################################
- name: Admin Interface | Lint - name: Admin Interface | Lint
run: docker run --rm gradido/admin:test yarn run lint run: cd admin && yarn && yarn run lint
############################################################################## ##############################################################################
# JOB: STYLELINT ADMIN INTERFACE ############################################# # JOB: STYLELINT ADMIN INTERFACE #############################################
@ -279,7 +235,6 @@ jobs:
stylelint_admin: stylelint_admin:
name: Stylelint - Admin Interface name: Stylelint - Admin Interface
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_admin]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -287,20 +242,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Admin Interface)
uses: actions/download-artifact@v3
with:
name: docker-admin-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/admin.tar
##########################################################################
# STYLELINT ADMIN INTERFACE ############################################## # STYLELINT ADMIN INTERFACE ##############################################
########################################################################## ##########################################################################
- name: Admin Interface | Stylelint - name: Admin Interface | Stylelint
run: docker run --rm gradido/admin:test yarn run stylelint run: cd admin && yarn && yarn run stylelint
############################################################################## ##############################################################################
# JOB: LOCALES ADMIN ######################################################### # JOB: LOCALES ADMIN #########################################################
@ -308,7 +253,6 @@ jobs:
locales_admin: locales_admin:
name: Locales - Admin Interface name: Locales - Admin Interface
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_admin]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -316,20 +260,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Admin Interface)
uses: actions/download-artifact@v3
with:
name: docker-admin-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/admin.tar
##########################################################################
# LOCALES FRONTEND ####################################################### # LOCALES FRONTEND #######################################################
########################################################################## ##########################################################################
- name: admin | Locales - name: Admin | Locales
run: docker run --rm gradido/admin:test yarn run locales run: cd admin && yarn && yarn run locales
############################################################################## ##############################################################################
# JOB: LINT BACKEND ########################################################## # JOB: LINT BACKEND ##########################################################
@ -337,7 +271,6 @@ jobs:
lint_backend: lint_backend:
name: Lint - Backend name: Lint - Backend
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_backend]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -345,20 +278,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v3
with:
name: docker-backend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/backend.tar
##########################################################################
# LINT BACKEND ########################################################### # LINT BACKEND ###########################################################
########################################################################## ##########################################################################
- name: backend | Lint - name: backend | Lint
run: docker run --rm gradido/backend:test yarn run lint run: cd backend && yarn && yarn run lint
############################################################################## ##############################################################################
# JOB: LOCALES BACKEND ####################################################### # JOB: LOCALES BACKEND #######################################################
@ -366,7 +289,6 @@ jobs:
locales_backend: locales_backend:
name: Locales - Backend name: Locales - Backend
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_backend]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -385,7 +307,6 @@ jobs:
lint_database_up: lint_database_up:
name: Lint - Database Up name: Lint - Database Up
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_database_up]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -393,20 +314,10 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v3
with:
name: docker-database-test_up
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/database_up.tar
##########################################################################
# LINT DATABASE ########################################################## # LINT DATABASE ##########################################################
########################################################################## ##########################################################################
- name: database | Lint - name: Database | Lint
run: docker run --rm gradido/database:test_up yarn run lint run: cd database && yarn && yarn run lint
############################################################################## ##############################################################################
# JOB: UNIT TEST FRONTEND ################################################### # JOB: UNIT TEST FRONTEND ###################################################
@ -414,7 +325,6 @@ jobs:
unit_test_frontend: unit_test_frontend:
name: Unit tests - Frontend name: Unit tests - Frontend
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_frontend]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -422,30 +332,12 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGES #################################################
##########################################################################
- name: Download Docker Image (Frontend)
uses: actions/download-artifact@v3
with:
name: docker-frontend-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/frontend.tar
##########################################################################
# UNIT TESTS FRONTEND #################################################### # UNIT TESTS FRONTEND ####################################################
########################################################################## ##########################################################################
- name: frontend | Unit tests - name: Frontend | Unit tests
run: | run: |
docker run --env NODE_ENV=test -v ~/coverage:/app/coverage --rm gradido/frontend:test yarn run test cd frontend && yarn && yarn run test
cp -r ~/coverage ./coverage cp -r ./coverage ../
##########################################################################
# COVERAGE REPORT FRONTEND ###############################################
##########################################################################
#- name: frontend | Coverage report
# uses: romeovs/lcov-reporter-action@v0.2.21
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# lcov-file: ./coverage/lcov.info
########################################################################## ##########################################################################
# COVERAGE CHECK FRONTEND ################################################ # COVERAGE CHECK FRONTEND ################################################
########################################################################## ##########################################################################
@ -454,7 +346,7 @@ jobs:
with: with:
report_name: Coverage Frontend report_name: Coverage Frontend
type: lcov type: lcov
result_path: ./coverage/lcov.info result_path: ./frontend/coverage/lcov.info
min_coverage: 95 min_coverage: 95
token: ${{ github.token }} token: ${{ github.token }}
@ -464,7 +356,6 @@ jobs:
unit_test_admin: unit_test_admin:
name: Unit tests - Admin Interface name: Unit tests - Admin Interface
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_test_admin]
steps: steps:
########################################################################## ##########################################################################
# CHECKOUT CODE ########################################################## # CHECKOUT CODE ##########################################################
@ -472,22 +363,12 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
########################################################################## ##########################################################################
# DOWNLOAD DOCKER IMAGES #################################################
##########################################################################
- name: Download Docker Image (Admin Interface)
uses: actions/download-artifact@v3
with:
name: docker-admin-test
path: /tmp
- name: Load Docker Image
run: docker load < /tmp/admin.tar
##########################################################################
# UNIT TESTS ADMIN INTERFACE ############################################# # UNIT TESTS ADMIN INTERFACE #############################################
########################################################################## ##########################################################################
- name: Admin Interface | Unit tests - name: Admin Interface | Unit tests
run: | run: |
docker run -v ~/coverage:/app/coverage --rm gradido/admin:test yarn run test cd admin && yarn && yarn run test
cp -r ~/coverage ./coverage cp -r ./coverage ../
########################################################################## ##########################################################################
# COVERAGE CHECK ADMIN INTERFACE ######################################### # COVERAGE CHECK ADMIN INTERFACE #########################################
########################################################################## ##########################################################################
@ -496,7 +377,7 @@ jobs:
with: with:
report_name: Coverage Admin Interface report_name: Coverage Admin Interface
type: lcov type: lcov
result_path: ./coverage/lcov.info result_path: ./admin/coverage/lcov.info
min_coverage: 97 min_coverage: 97
token: ${{ github.token }} token: ${{ github.token }}
@ -534,8 +415,9 @@ jobs:
- name: backend | docker-compose database - name: backend | docker-compose database
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database
- name: backend Unit tests | test - name: backend Unit tests | test
run: cd database && yarn && yarn build && cd ../backend && yarn && yarn test run: |
# run: docker-compose -f docker-compose.yml -f docker-compose.test.yml exec -T backend yarn test cd database && yarn && yarn build && cd ../backend && yarn && yarn test
cp -r ./coverage ../
########################################################################## ##########################################################################
# COVERAGE CHECK BACKEND ################################################# # COVERAGE CHECK BACKEND #################################################
########################################################################## ##########################################################################