Skip to content

CPU and Max RSS Analysis tools #646

CPU and Max RSS Analysis tools

CPU and Max RSS Analysis tools #646

name: conda builds
on:
pull_request:
paths:
- 'conda-environment.yml'
- '.github/workflows/test_conda-build.yml'
- 'pyproject.toml'
- 'setup.cfg'
schedule:
- cron: '17 22 * * 6' # Every Saturday at 22:17
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
FORCE_COLOR: 2
jobs:
test_conda_install:
if: github.repository_owner == 'cylc' || github.event_name != 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3']
env:
ENV_FILE: conda-environment.yml
# prevent pip from meddling with the conda installed dependencies (during the conda build step)
PIP_NO_DEPS: True
steps:
- name: checkout cylc-flow
uses: actions/checkout@v6
- name: modify conda env file
run: |
# write environment file
echo " - python = ${{ matrix.python-version }}" >> "$ENV_FILE"
echo " - pip" >> "$ENV_FILE" # list pip as a dependency
echo " - pip:" >> "$ENV_FILE" # add a pip section
echo " - ." >> "$ENV_FILE" # install cylc-flow (pip install .)
cat "$ENV_FILE"
- name: build conda env
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: ${{ env.ENV_FILE }}
- name: check cylc installation
shell: bash -el {0}
run: |
# make sure Cylc is functioning
conda run -n test cylc version --long
# make sure pip is happy with the packages installed
# (checks pip deps are compatible with conda deps)
conda run -n test pip check
- name: check for activate scripts
shell : bash -el {0}
run: |
# https://github.com/cylc/cylc-flow/issues/3704#issuecomment-897442365
# locate all activate scripts
find "$CONDA_PREFIX" -name "activate.d" | tee > activates.txt
# ignore the conda activate script itself
sed -i "\|$CONDA_PREFIX/etc/conda/activate.d|d" activates.txt
# check to make sure no packages have contributed new activate scripts
# (we rely on having a conda activate-less environment)
if [[ $(wc -l < activates.txt) -ne 0 ]]; then
echo '::error::Found activate scripts in installation.'
cat activates.txt >&2
exit 1
fi