How to using conda environment in all steps of .yaml file?

I am running a .yaml file where I am testing functions in R that interact with python using reticualte, the workflow involves: 1) installing python and conda, 2) initialize conda environment, and 3) test R-function that require conda environment. However, between steps it does not seem to be the same environment anymore, which to me seems strange? Heres what I do:

  1. Running my installation function in R works fine and all required packages are installed:
      - name: Install required python packages for R-package
        run: r_package::install_pythonpackages()
  1. Initializing the conda environment with required python packages works fine.
      - name: Initiate required python packages for R-package
        run: r_package::initialize_environment()
  1. However, running the R-package function that needs the required packages give error about missing packages that was successfully installed and initialised in the previous steps.
    [and adding this function in the end of the initialize_environment() works fine; so it appears that this next step are not using the previously initialised environment]
      - name: Check textEmbed
        run: r_package::FunctionNeedingPythonPackages()