- refactored dependencies

- removed forced step between building and testing
This commit is contained in:
Ulf Gebhardt 2021-01-30 05:56:56 +01:00
parent 6638e2d414
commit 6805863ac9
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View File

@ -102,17 +102,6 @@ jobs:
with:
name: docker-webapp-image
path: /tmp/webapp.tar
##############################################################################
# JOB: AFTER DOCKER BUILD ####################################################
##############################################################################
after_docker_build:
name: After Build
runs-on: ubuntu-latest
needs: [build_test_neo4j, build_test_backend, build_test_webapp]
steps:
- name: Do nothing
run: echo "I do nothing"
##############################################################################
# JOB: LINT BACKEND ##########################################################
@ -120,7 +109,7 @@ jobs:
lint_backend:
name: Lint backend
runs-on: ubuntu-latest
needs: after_docker_build
needs: [build_test_backend]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
@ -130,7 +119,7 @@ jobs:
##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Artifact)
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v2
with:
name: docker-backend-image
@ -147,9 +136,9 @@ jobs:
# JOB: LINT WEBAPP ###########################################################
##############################################################################
lint_webapp:
name: Lint backend
name: Lint webapp
runs-on: ubuntu-latest
needs: after_docker_build
needs: [build_test_webapp]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
@ -159,7 +148,7 @@ jobs:
##########################################################################
# DOWNLOAD DOCKER IMAGE ##################################################
##########################################################################
- name: Download Docker Image (Artifact)
- name: Download Docker Image (Webapp)
uses: actions/download-artifact@v2
with:
name: docker-webapp-image
@ -173,34 +162,75 @@ jobs:
run: docker run --rm ocelotsocialnetwork/webapp:build yarn run lint
##############################################################################
# JOB: UNIT TESTS ############################################################
# JOB: UNIT TEST BACKEND #####################################################
##############################################################################
#unit_tests:
# name: Unit Tests
# runs-on: ubuntu-latest
# needs: prepare
# steps:
unit_test_backend:
name: Unit tests - backend
runs-on: ubuntu-latest
needs: [build_test_neo4j,build_test_backend]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
#- name: Checkout code
# uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOWNLOAD DOCKER IMAGES #################################################
##########################################################################
- name: Download Docker Image (Neo4J)
uses: actions/download-artifact@v2
with:
name: docker-neo4j-image
path: /tmp/neo4j.tar
- name: Load Docker Image
run: docker load < /tmp/neo4j.tar
- name: Download Docker Image (Backend)
uses: actions/download-artifact@v2
with:
name: docker-backend-image
path: /tmp/backend.tar
- name: Load Docker Image
run: docker load < /tmp/backend.tar
##########################################################################
# UNIT TESTS BACKEND #####################################################
##########################################################################
#- name: backend | copy env files (webapp, backend)
# run: cp webapp/.env.template webapp/.env
# run: cp backend/.env.template backend/.env
#- name: backend | docker-compose
# run: docker-compose up
#- name: backend | Unit tests
# run: docker-compose exec backend yarn test
- name: backend | copy env files (webapp, backend)
run: cp webapp/.env.template webapp/.env
run: cp backend/.env.template backend/.env
- name: backend | docker-compose
run: docker-compose up
- name: backend | Unit tests
run: docker-compose exec backend yarn test
#run: docker run --network container:webapp-frontend appropriate/curl -s --retry 10 --retry-connrefused http://localhost:5000/
##############################################################################
# JOB: UNIT TEST WEBAPP ######################################################
##############################################################################
unit_test_webapp:
name: Unit tests - webapp
runs-on: ubuntu-latest
needs: [build_test_webapp]
steps:
##########################################################################
# CHECKOUT CODE ##########################################################
##########################################################################
- name: Checkout code
uses: actions/checkout@v2
##########################################################################
# DOWNLOAD DOCKER IMAGES #################################################
##########################################################################
- name: Download Docker Image (Webapp)
uses: actions/download-artifact@v2
with:
name: docker-webapp-image
path: /tmp/webapp.tar
- name: Load Docker Image
run: docker load < /tmp/webapp.tar
##########################################################################
# UNIT TESTS WEBAPP #####################################################
##########################################################################
#- name: webapp | Unit tests
# run: docker run --rm ocelotsocialnetwork/webapp:build yarn run test
- name: webapp | Unit tests
run: docker run --rm ocelotsocialnetwork/webapp:build yarn run test
##############################################################################
# JOB: DOCKER BUILD PRODUCTION & PUSH ########################################