Files
directus/.github/workflows/ci.yml

77 lines
2.6 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ### Continuous Integration
#
# Entrypoint for all CI related workflows
#
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pre_check:
name: Pre-Check
runs-on: ubuntu-latest
outputs:
# Returns 'true' if the whole workflow is skippable for one of the following reasons:
# - Exact same files have been successfully checked in older workflow run
# - Only files that do not require checks ('paths_ignore') have been changed and
# workflow run on previous commit has been successful (backtracking)
should_skip: ${{ steps.skip_check.outputs.should_skip }}
# Returns information about the defined filter in 'paths_filter'
paths_result: ${{ steps.skip_check.outputs.paths_result }}
steps:
- name: Check for skippable jobs
id: skip_check
# Switch back to fkirc/skip-duplicate-actions@master once https://github.com/fkirc/skip-duplicate-actions/pull/159 has been merged
uses: paescuj/skip-duplicate-actions@path-filters
# Don't skip any jobs if the pre-check should fail for any reason
# (setting this on step-level makes sure the pre-check will still be marked as 'passed',
# better solution pending at https://github.com/actions/toolkit/issues/399)
continue-on-error: true
with:
# Cancel outdated workflow runs
cancel_others: 'true'
# Ignore changes in the following files globally
paths_ignore: '["app/src/lang/translations/*.yaml"]'
# Paths filter
paths_filter: |
e2e_tests:
paths:
- 'api/**/*'
- 'tests/**/*'
- 'docker-compose.yml'
- '.github/workflows/e2e-tests.yml'
lint:
name: Lint
needs: pre_check
uses: directus/directus/.github/workflows/lint.yml@main
with:
should_skip: ${{ needs.pre_check.outputs.should_skip }}
codeql_analysis:
name: CodeQL Analysis
needs: pre_check
uses: directus/directus/.github/workflows/codeql-analysis.yml@main
with:
should_skip: ${{ needs.pre_check.outputs.should_skip }}
unit_tests:
name: Unit Tests
needs: pre_check
uses: directus/directus/.github/workflows/unit-tests.yml@main
with:
should_skip: ${{ needs.pre_check.outputs.should_skip }}
e2e_tests:
name: End-to-End Tests
needs: pre_check
uses: directus/directus/.github/workflows/e2e-tests.yml@main
with:
should_skip: ${{ needs.pre_check.outputs.should_skip == 'true' || fromJSON(needs.pre_check.outputs.paths_result).e2e_tests.should_skip }}