Files
directus/.github/workflows/ci.yml
Oreille 7e10d2017e End-to-end tests refactor (#10968)
* Refactor e2e tests

* Only install root dependencies for lint step

* Fix dumbest error ever

* Pass process.env too to spawned subprocess

* Suppress npm package installation prompt

* Improve error handling

* Add new compose file for tests

* Avoid port conflict with remoted

* Update docker-compose.yml

* Add test docs

* Use current branch workflow files and simplify skips

* Fix workflow file

* Fix workflow file

* Try adding `.yml` extension to allow reference in `uses`

* Place workflow file in folders to allow reference in `uses`

* Requires more work than expected, reverting

* Update docs to use correct compose file

* Remove comment / unused code

* Run tests from main

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Jay Cammarano <jay.cammarano@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-01-13 16:32:45 -05:00

73 lines
2.5 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
if: needs.pre_check.should_skip != 'true'
codeql_analysis:
name: CodeQL Analysis
needs: pre_check
uses: directus/directus/.github/workflows/codeql-analysis.yml@main
if: needs.pre_check.should_skip != 'true'
unit_tests:
name: Unit Tests
needs: pre_check
if: needs.pre_check.should_skip != 'true'
uses: directus/directus/.github/workflows/unit-tests.yml@main
e2e_tests:
name: End-to-End Tests
needs: pre_check
uses: directus/directus/.github/workflows/e2e-tests.yml@main
if: needs.pre_check.should_skip != 'true' || fromJSON(needs.pre_check.outputs.paths_result).e2e_tests.should_skip