@@ -17,45 +17,36 @@ jobs:
17
17
test_conda_install :
18
18
runs-on : ubuntu-latest
19
19
timeout-minutes : 10
20
- strategy :
21
- matrix :
22
- python-version : ['3.8', '3']
23
- env :
24
- ENV_FILE : conda-environment.yml
25
20
steps :
26
21
- name : checkout cylc-flow
27
22
uses : actions/checkout@v4
28
23
29
- - name : modify conda env file
30
- run : |
31
- # write environment file
32
- echo " - pip" >> "$ENV_FILE" # list pip as a dependency
33
- echo " - pip:" >> "$ENV_FILE" # add a pip section
34
- echo " - ." >> "$ENV_FILE" # install cylc-flow (pip install .)
35
- cat "$ENV_FILE"
36
-
37
24
- name : build conda env
38
- uses : conda-incubator/setup-miniconda@v3
39
- with :
40
- python-version : ${{ matrix.python-version }}
41
- environment-file : ${{ env.ENV_FILE }}
42
-
43
- - name : check cylc installation
44
- shell : bash -el {0}
45
25
run : |
46
- conda run -n test cylc version --long
26
+ # write environment file
27
+ env_file='conda-environment.yml'
28
+ echo " - pip" >> "$env_file" # list pip as a dependency
29
+ echo " - pip:" >> "$env_file" # add a pip section
30
+ echo " - ." >> "$env_file" # install cylc-flow (pip install .)
31
+ cat "$env_file"
32
+ # install environment
33
+ conda env create \
34
+ -f "$env_file" \
35
+ --prefix cylc-dev
36
+ . /usr/share/miniconda/etc/profile.d/conda.sh
37
+ # check cylc-flow was installed correctly
38
+ conda run --prefix cylc-dev cylc version --long
47
39
48
40
- name : check for activate scripts
49
- shell : bash -el {0}
50
41
run : |
51
42
# https://github.com/cylc/cylc-flow/issues/3704#issuecomment-897442365
52
43
# locate all activate scripts
53
- find "$CONDA_PREFIX" -name "activate.d" | tee > activates.txt
44
+ find ./cylc-dev/ -name "activate.d" | tee > activates.txt
54
45
# ignore the conda activate script itself
55
- sed -i "\|$CONDA_PREFIX /etc/conda/activate.d|d" activates.txt
46
+ sed -i '/cylc-dev\ /etc\ /conda\ /activate.d/d' activates.txt
56
47
# check to make sure no packages have contributed new activate scripts
57
48
# (we rely on having a conda activate-less environment)
58
- if [[ $(wc -l < activates.txt) -ne 0 ]]; then
49
+ if [[ $(cat activates.txt | wc -l ) -ne 0 ]]; then
59
50
echo '::error::Found activate scripts in installation.'
60
51
cat activates.txt >&2
61
52
exit 1
0 commit comments