Skip to content

new 23.01.17 LTS #18764

new 23.01.17 LTS

new 23.01.17 LTS #18764

name: Core
on:
pull_request:
push:
branches:
- master
- release-*
jobs:
repo-metadata-job:
name: Get Github Metadata
runs-on: ubuntu-latest
outputs:
commit_message: ${{ steps.get-commit-message.outputs.commit_message }}
module_found: ${{ steps.module-matcher.outputs.module_found }}
steps:
- id: fetch-core
name: Fetch Core repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: read-cicd-local-env
name: Read CICD local library
run: source ${GITHUB_WORKSPACE}/cicd/local-env.sh
- id: module-matcher
name: Module Matcher
uses: ./.github/actions/module-matcher
with:
build_id: ${{ env.BUILD_ID }}
current: core
- id: get-commit-message
name: Get commit message
uses: dotcms/get-commit-message@master
with:
accessToken: ${{ secrets.GITHUB_TOKEN }}
build-core-job:
name: Build Core
runs-on: ubuntu-latest
needs: repo-metadata-job
if: needs.repo-metadata-job.outputs.module_found == 'true'
env:
DEBUG: true
outputs:
cache_metadata: ${{ steps.cache-core.outputs.cache_metadata }}
steps:
- id: fetch-core
name: Fetch Core repo
uses: actions/checkout@v3
- id: read-cicd-local-env
name: Read CICD local library
run: source ${GITHUB_WORKSPACE}/cicd/local-env.sh
if: success()
- id: build-core
name: Build Core
uses: ./.github/actions/build-core
with:
build_env: ${{ env.BUILD_ENV }}
if: success()
- id: core-cache-locator
name: Core Cache Locator
uses: ./.github/actions/core-cache-locator
with:
build_env: ${{ env.BUILD_ENV }}
cache_build_output: false
if: success()
- id: cache-core
name: Cache Core
uses: ./.github/actions/cache-core
with:
build_env: ${{ env.BUILD_ENV }}
cache_locations: ${{ steps.core-cache-locator.outputs.cache_locations }}
if: success()
run-unit-tests-job:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: [repo-metadata-job, build-core-job]
if: success()
outputs:
tests_results_status: ${{ steps.run-unit-tests.outputs.tests_results_status }}
tests_results_skip_report: ${{ steps.run-unit-tests.outputs.tests_results_skip_report }}
tests_results_report_url: ${{ steps.github-publish-unit-tests.outputs.tests_report_url }}
tests_results_log_url: ${{ steps.github-publish-unit-tests.outputs.test_logs_url }}
env:
DEBUG: true
steps:
- id: fetch-core
name: Fetch Core Repo
uses: actions/checkout@v3
- id: read-cicd-local-env
name: Read CICD local library
run: source ${GITHUB_WORKSPACE}/cicd/local-env.sh
if: success()
- id: restore-core
name: Restore Core Cache
uses: ./.github/actions/restore-core
with:
cache_metadata: ${{ needs.build-core-job.outputs.cache_metadata }}
if: success()
- id: run-unit-tests
name: Run Unit Tests
uses: ./.github/actions/run-unit-tests
with:
build_env: ${{ env.BUILD_ENV }}
tests: ${{ needs.repo-metadata-job.outputs.commit_message }}
- id: unit-tests-comment
name: Unit Test Comment
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ steps.run-unit-tests.outputs.tests_results_location }}/*.xml
check_name: 'Unit Tests Report'
if: (success() || failure()) && steps.run-unit-tests.outputs.tests_results_skip_report != 'true'
- id: github-publish-unit-tests
name: Github publish unit tests
uses: ./.github/actions/publish-test-results
with:
build_id: ${{ env.BUILD_ID }}
build_hash: ${{ env.BUILD_HASH }}
test_type: unit
pull_request: ${{ github.event.number }}
tests_results_status: ${{ steps.run-unit-tests.outputs.tests_results_status }}
tests_results_report_location: ${{ steps.run-unit-tests.outputs.tests_results_report_location }}
cicd_github_token: ${{ secrets.CICD_GITHUB_TOKEN }}
if: (success() || failure()) && steps.run-unit-tests.outputs.tests_results_skip_report != 'true'
- id: github-status
name: Send Github Status
uses: ./.github/actions/github-status
with:
test_type: unit
test_results_status: ${{ steps.run-unit-tests.outputs.tests_results_status }}
pull_request: ${{ github.event.number }}
github_user: ${{ env.GITHUB_USER }}
cicd_github_token: ${{ secrets.CICD_GITHUB_TOKEN }}
tests_report_url: ${{ steps.github-publish-unit-tests.outputs.test_logs_url }}
if: (success() || failure()) && steps.github-publish-unit-tests.outputs.tests_report_url != ''
run-integration-tests-job:
name: Run Integration Tests
runs-on: ubuntu-latest
needs: [repo-metadata-job, build-core-job ]
strategy:
fail-fast: false
matrix:
db_type: [ postgres ]
if: success()
outputs:
postgres_tests_results_status: ${{ steps.run-integration-tests.outputs.postgres_tests_results_status }}
postgres_tests_results_skip_report: ${{ steps.run-integration-tests.outputs.postgres_tests_results_skip_report }}
postgres_tests_results_report_url: ${{ steps.github-publish-integration-tests.outputs.postgres_tests_report_url }}
postgres_tests_results_log_url: ${{ steps.github-publish-integration-tests.outputs.postgres_test_logs_url }}
mssql_tests_results_status: ${{ steps.run-integration-tests.outputs.mssql_tests_results_status }}
mssql_tests_results_skip_report: ${{ steps.run-integration-tests.outputs.mssql_tests_results_skip_report }}
mssql_tests_results_report_url: ${{ steps.github-publish-integration-tests.outputs.mssql_tests_report_url }}
mssql_tests_results_log_url: ${{ steps.github-publish-integration-tests.outputs.mssql_test_logs_url }}
env:
DEBUG: true
steps:
- id: fetch-core
name: Fetch Core Repo
uses: actions/checkout@v3
- id: read-cicd-local-env
name: Read CICD local library
run: source ${GITHUB_WORKSPACE}/cicd/local-env.sh
if: success()
- id: restore-core
name: Restore Core Cache
uses: ./.github/actions/restore-core
with:
cache_metadata: ${{ needs.build-core-job.outputs.cache_metadata }}
if: success()
- id: run-integration-tests
name: Run Integration Tests
uses: ./.github/actions/run-integration-tests
with:
build_env: ${{ env.BUILD_ENV }}
db_type: ${{ matrix.db_type }}
license_key: ${{ secrets.DOTCMS_LICENSE }}
tests: ${{ needs.repo-metadata-job.outputs.commit_message }}
if: success()
- id: integration-tests-comment
name: Integration Test Comment
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ steps.run-integration-tests.outputs.tests_results_location }}/*.xml
check_name: 'Integration Tests [${{ matrix.db_type }}] Report'
if: (success() || failure()) && steps.run-integration-tests.outputs.tests_results_skip_report != 'true'
- id: github-publish-integration-tests
name: Github publish integration tests
uses: ./.github/actions/publish-test-results
with:
build_id: ${{ env.BUILD_ID }}
build_hash: ${{ env.BUILD_HASH }}
test_type: integration
db_type: ${{ matrix.db_type }}
pull_request: ${{ github.event.number }}
tests_results_status: ${{ steps.run-integration-tests.outputs.tests_results_status }}
tests_results_report_location: ${{ steps.run-integration-tests.outputs.tests_results_report_location }}
cicd_github_token: ${{ secrets.CICD_GITHUB_TOKEN }}
if: (success() || failure()) && steps.run-integration-tests.outputs.tests_results_skip_report != 'true'
- id: github-status
name: Send Github Status
uses: ./.github/actions/github-status
with:
test_type: integration
db_type: ${{ matrix.db_type }}
test_results_status: ${{ steps.run-integration-tests.outputs.tests_results_status }}
pull_request: ${{ github.event.number }}
github_user: ${{ env.GITHUB_USER }}
cicd_github_token: ${{ secrets.CICD_GITHUB_TOKEN }}
tests_report_url: ${{ steps.github-publish-integration-tests.outputs.tests_report_url }}
if: (success() || failure()) && steps.github-publish-integration-tests.outputs.tests_report_url != ''
run-postman-tests-job:
name: Run Postman Tests
runs-on: ubuntu-latest
needs: repo-metadata-job
if: success() && needs.repo-metadata-job.outputs.module_found == 'true'
outputs:
tests_results_status: ${{ steps.run-postman-tests.outputs.tests_results_status }}
tests_results_skip_report: ${{ steps.run-postman-tests.outputs.tests_results_skip_report }}
tests_results_report_url: ${{ steps.github-publish-postman-tests.outputs.tests_report_url }}
tests_results_log_url: ${{ steps.github-publish-postman-tests.outputs.test_logs_url }}
env:
PUBLISH_MODE: ALL
DEBUG: true
steps:
- id: fetch-core
name: Fetch Core Repo
uses: actions/checkout@v3
- id: read-cicd-local-env
name: Read CICD local library
run: source ${GITHUB_WORKSPACE}/cicd/local-env.sh
if: success()
- id: build-dotcms-image
name: Build DotCMS Docker image
uses: ./.github/actions/build-docker-image
with:
build_id : ${{ env.BUILD_ID }}
image_name: dotcms:${{ env.BUILD_HASH }}
- id: run-postman-tests
name: Run Postman Tests
timeout-minutes: 180
uses: ./.github/actions/run-postman-tests
with:
built_image_name: ${{ steps.build-dotcms-image.outputs.built_image_name }}
license_key: ${{ secrets.DOTCMS_LICENSE }}
tests: ${{ needs.repo-metadata-job.outputs.commit_message }}
export_report: ${{ env.PUBLISH_MODE == 'ALL' || env.PUBLISH_MODE == 'RESULTS' }}
- id: postman-tests-comment
name: Postman Test Comment
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: ${{ steps.run-postman-tests.outputs.tests_results_location }}/*.xml
check_name: 'Postman Tests Report'
if: (success() || failure()) && steps.run-postman-tests.outputs.tests_results_skip_report != 'true'
- id: github-publish-postman-tests
name: Github publish postman tests
uses: ./.github/actions/publish-test-results
with:
build_id: ${{ env.BUILD_ID }}
build_hash: ${{ env.BUILD_HASH }}
test_type: postman
pull_request: ${{ github.event.number }}
tests_results_status: ${{ steps.run-postman-tests.outputs.tests_results_status }}
tests_results_report_location: ${{ steps.run-postman-tests.outputs.tests_results_report_location }}
cicd_github_token: ${{ secrets.CICD_GITHUB_TOKEN }}
mode: ${{ env.PUBLISH_MODE }}
if: (success() || failure()) && steps.run-postman-tests.outputs.tests_results_skip_report != 'true'
- id: github-status
name: Send Github Status
uses: ./.github/actions/github-status
with:
test_type: postman
test_results_status: ${{ steps.run-postman-tests.outputs.tests_results_status }}
pull_request: ${{ github.event.number }}
github_user: ${{ env.GITHUB_USER }}
cicd_github_token: ${{ secrets.CICD_GITHUB_TOKEN }}
tests_report_url: ${{ steps.github-publish-postman-tests.outputs.tests_report_url }}
if: (success() || failure()) && steps.github-publish-postman-tests.outputs.tests_report_url != ''
test-results-handler-job:
name: Tests results handler
runs-on: ubuntu-latest
needs: [run-unit-tests-job, run-integration-tests-job, run-postman-tests-job]
if: (success() || failure()) && (needs.run-unit-tests-job.outputs.tests_results_report_url != '' || needs.run-integration-tests-job.outputs.postgres_tests_results_report_url != '' || needs.run-integration-tests-job.outputs.mssql_tests_results_report_url != '' || needs.run-postman-tests-job.outputs.tests_results_report_url != '')
steps:
- id: fetch-core
name: Fetch Core Repo
uses: actions/checkout@v3
- id: tests-status-aggregator
name: Tests status aggregator
uses: ./.github/actions/tests-status-aggregator
with:
unit_tests_results_status: ${{ needs.run-unit-tests-job.outputs.tests_results_status }}
unit_tests_results_report_url: ${{ needs.run-unit-tests-job.outputs.tests_results_report_url }}
unit_tests_results_log_url: ${{ needs.run-unit-tests-job.outputs.tests_results_log_url }}
integration_postgres_tests_results_status: ${{ needs.run-integration-tests-job.outputs.postgres_tests_results_status }}
integration_postgres_tests_results_report_url: ${{ needs.run-integration-tests-job.outputs.postgres_tests_results_report_url }}
integration_postgres_tests_results_log_url: ${{ needs.run-integration-tests-job.outputs.postgres_tests_results_log_url }}
integration_mssql_tests_results_status: ${{ needs.run-integration-tests-job.outputs.mssql_tests_results_status }}
integration_mssql_tests_results_report_url: ${{ needs.run-integration-tests-job.outputs.mssql_tests_results_report_url }}
integration_mssql_tests_results_log_url: ${{ needs.run-integration-tests-job.outputs.mssql_tests_results_log_url }}
postman_tests_results_status: ${{ needs.run-postman-tests-job.outputs.tests_results_status }}
postman_tests_results_report_url: ${{ needs.run-postman-tests-job.outputs.tests_results_report_url }}
postman_tests_results_log_url: ${{ needs.run-postman-tests-job.outputs.tests_results_log_url }}