blob: 07c7724f3615d56917be93ad3f5b1c60c6b7a02d [file]
# Affected-test selection for the `affected-tests` merge request label.
# SPDX-FileCopyrightText: The Eigen Authors
# SPDX-License-Identifier: MPL-2.0
#
# Emits the set of tests reachable from the merge request diff, which the
# affected-tier build and test jobs consume. See scripts/affected_tests.py for
# the selection rules and .agents/ci.md for how the tier fits the CI matrix.
select:tests:
stage: select
image: ${EIGEN_CI_IMAGE_LINUX_LINT}
needs: []
rules: !reference [.rules:libeigen:affected-tests, rules]
variables:
# The selector diffs against the merge-base, which a shallow clone may not
# contain.
GIT_DEPTH: 0
script:
- python3 scripts/test_affected_tests.py
- python3 scripts/affected_tests.py
--base-sha "${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
--output-dir affected
- echo "Build target selection:" && cat affected/targets.txt
# A NONE selection compiles nothing, so its build jobs skip downloading the
# ccache pool: `push` never restores, and nothing is left to push.
- if [ "$(cat affected/targets.txt)" = "NONE" ]; then policy=push; else policy=pull-push; fi
- echo "EIGEN_CI_CCACHE_POLICY=${policy}" > affected/ccache.env
artifacts:
when: always
name: "$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG"
paths:
- affected/
reports:
dotenv: affected/ccache.env
expire_in: 2 days
tags:
- saas-linux-medium-amd64