Files
directus/.github/workflows/ci.yml
Nicola Krumschmidt aa5da81fc0 Remove no-break space characters with regular spaces (#11232)
There are quite a few other occurrences all over the translation files,
some of which feel intentionally placed.
2022-01-24 09:43:57 -05:00

82 lines
2.8 KiB
YAML

# ### 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/{ci,e2e-tests}.yml'
# Workflows are called in every case and need to handle the value of should_skip themselves.
# This is needed to pass required checks on pull requests.
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 }}