mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
separate frontend test workflow from general test workflow
This commit is contained in:
parent
8716f39b91
commit
16e166d4ac
107
.github/workflows/test.yml
vendored
107
.github/workflows/test.yml
vendored
@ -3,32 +3,6 @@ name: gradido test CI
|
|||||||
on: push
|
on: push
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
##############################################################################
|
|
||||||
# JOB: DOCKER BUILD TEST FRONTEND ############################################
|
|
||||||
##############################################################################
|
|
||||||
build_test_frontend:
|
|
||||||
name: Docker Build Test - Frontend
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
#needs: [nothing]
|
|
||||||
steps:
|
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
##########################################################################
|
|
||||||
# FRONTEND ###############################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Frontend | Build `test` image
|
|
||||||
run: |
|
|
||||||
docker build --target test -t "gradido/frontend:test" frontend/
|
|
||||||
docker save "gradido/frontend:test" > /tmp/frontend.tar
|
|
||||||
- name: Upload Artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: docker-frontend-test
|
|
||||||
path: /tmp/frontend.tar
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# JOB: DOCKER BUILD TEST BACKEND #############################################
|
# JOB: DOCKER BUILD TEST BACKEND #############################################
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -132,60 +106,6 @@ jobs:
|
|||||||
name: docker-nginx-test
|
name: docker-nginx-test
|
||||||
path: /tmp/nginx.tar
|
path: /tmp/nginx.tar
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: LOCALES FRONTEND ######################################################
|
|
||||||
##############################################################################
|
|
||||||
locales_frontend:
|
|
||||||
name: Locales - Frontend
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
##########################################################################
|
|
||||||
# LOCALES FRONTEND #######################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Frontend | Locales
|
|
||||||
run: cd frontend && yarn && yarn run locales
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: LINT FRONTEND #########################################################
|
|
||||||
##############################################################################
|
|
||||||
lint_frontend:
|
|
||||||
name: Lint - Frontend
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
##########################################################################
|
|
||||||
# LINT FRONTEND ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Frontend | Lint
|
|
||||||
run: cd frontend && yarn && yarn run lint
|
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: STYLELINT FRONTEND ####################################################
|
|
||||||
##############################################################################
|
|
||||||
stylelint_frontend:
|
|
||||||
name: Stylelint - Frontend
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
##########################################################################
|
|
||||||
# STYLELINT FRONTEND #####################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Frontend | Stylelint
|
|
||||||
run: cd frontend && yarn && yarn run stylelint
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# JOB: LINT BACKEND ##########################################################
|
# JOB: LINT BACKEND ##########################################################
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -240,24 +160,6 @@ jobs:
|
|||||||
- name: Database | Lint
|
- name: Database | Lint
|
||||||
run: cd database && yarn && yarn run lint
|
run: cd database && yarn && yarn run lint
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# JOB: UNIT TEST FRONTEND ###################################################
|
|
||||||
##############################################################################
|
|
||||||
unit_test_frontend:
|
|
||||||
name: Unit tests - Frontend
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
##########################################################################
|
|
||||||
# CHECKOUT CODE ##########################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
##########################################################################
|
|
||||||
# UNIT TESTS FRONTEND ####################################################
|
|
||||||
##########################################################################
|
|
||||||
- name: Frontend | Unit tests
|
|
||||||
run: cd frontend && yarn && yarn run test
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# JOB: UNIT TEST BACKEND ####################################################
|
# JOB: UNIT TEST BACKEND ####################################################
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -323,7 +225,7 @@ jobs:
|
|||||||
end-to-end-tests:
|
end-to-end-tests:
|
||||||
name: End-to-End Tests
|
name: End-to-End Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [build_test_mariadb, build_test_database_up, build_test_frontend, build_test_nginx]
|
needs: [build_test_mariadb, build_test_database_up, build_test_nginx]
|
||||||
steps:
|
steps:
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# CHECKOUT CODE ##########################################################
|
# CHECKOUT CODE ##########################################################
|
||||||
@ -347,13 +249,6 @@ jobs:
|
|||||||
path: /tmp
|
path: /tmp
|
||||||
- name: Load Docker Image (Database Up)
|
- name: Load Docker Image (Database Up)
|
||||||
run: docker load < /tmp/database_up.tar
|
run: docker load < /tmp/database_up.tar
|
||||||
- name: Download Docker Image (Frontend)
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: docker-frontend-test
|
|
||||||
path: /tmp
|
|
||||||
- name: Load Docker Image (Frontend)
|
|
||||||
run: docker load < /tmp/frontend.tar
|
|
||||||
- name: Download Docker Image (Nginx)
|
- name: Download Docker Image (Nginx)
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
84
.github/workflows/test_frontend.yml
vendored
Normal file
84
.github/workflows/test_frontend.yml
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
name: Gradido Frontend Test CI
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# only (but most important) job from this workflow required for pull requests
|
||||||
|
# check results serve as run conditions for all other jobs here
|
||||||
|
files-changed:
|
||||||
|
name: Detect File Changes - Frontend
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
frontend: ${{ steps.changes.outputs.frontend }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3.3.0
|
||||||
|
|
||||||
|
- name: Check for frontend file changes
|
||||||
|
uses: dorny/paths-filter@v2.11.1
|
||||||
|
id: changes
|
||||||
|
with:
|
||||||
|
token: ${{ github.token }}
|
||||||
|
filters: .github/file-filters.yml
|
||||||
|
list-files: shell
|
||||||
|
|
||||||
|
|
||||||
|
build_test:
|
||||||
|
if: needs.files-changed.outputs.frontend == 'true'
|
||||||
|
name: Docker Build Test - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Build 'test' image
|
||||||
|
run: docker build --target test -t "gradido/frontend:test" frontend/ --build-arg NODE_ENV="test"
|
||||||
|
|
||||||
|
unit_test:
|
||||||
|
if: needs.files-changed.outputs.frontend == 'true'
|
||||||
|
name: Unit Tests - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Unit tests
|
||||||
|
run: cd frontend && yarn && yarn run test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
if: needs.files-changed.outputs.frontend == 'true'
|
||||||
|
name: Lint - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Lint
|
||||||
|
run: cd frontend && yarn && yarn run lint
|
||||||
|
|
||||||
|
stylelint:
|
||||||
|
if: needs.files-changed.outputs.frontend == 'true'
|
||||||
|
name: Stylelint - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Stylelint
|
||||||
|
run: cd frontend && yarn && yarn run stylelint
|
||||||
|
|
||||||
|
locales:
|
||||||
|
if: needs.files-changed.outputs.frontend == 'true'
|
||||||
|
name: Locales - Frontend
|
||||||
|
needs: files-changed
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Frontend | Locales
|
||||||
|
run: cd frontend && yarn && yarn run locales
|
||||||
Loading…
x
Reference in New Issue
Block a user