diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 8ceef148..85d3bae4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -35,7 +35,21 @@ jobs: - name: Get Date id: get-date run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT - shell: bash + + - name: Set Cache Path and Conda PATH + run: | + if [[ "${{ runner.os }}" == "Windows" ]]; then + echo "CACHE_ENV_PATH=C:\\Users\\runneradmin\\miniconda3" >> $GITHUB_ENV + else + echo "CACHE_ENV_PATH=$HOME/miniconda3" >> $GITHUB_ENV + fi + + - name: Restore cache + uses: actions/cache/restore@v4 + with: + path: ${{env.CACHE_ENV_PATH}} + key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} + id: restore-cache - name: Setup Conda Environment uses: conda-incubator/setup-miniconda@v3 @@ -55,14 +69,30 @@ jobs: key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} id: cache - - name: Update environment + - name: Update Environment (Windows) run: | - mamba install "setuptools>=69" "pip>=24" + call "%CONDA%\etc\profile.d\conda.bat" + conda activate cadet-process mamba install python=${{ matrix.python-version }} - echo "python=${{ matrix.python-version }}.*" > $CONDA_PREFIX/conda-meta/pinned - mamba env update -n cadet-process -f ${{ env.CONDA_FILE }} - if: steps.cache.outputs.cache-hit != 'true' + echo "python=${{ matrix.python-version }}.*" > %CONDA_PREFIX%\conda-meta\pinned + mamba env update -n cadet-process -f %CONDA_FILE% + where python + python --version + shell: cmd /C call {0} + - name: Install (Windows) + run: | + call "%CONDA%\etc\profile.d\conda.bat" + conda activate cadet-process + pip install -e ./[testing] + shell: cmd /C call {0} + + - name: Run Tests (Windows) + run: | + call "%CONDA%\etc\profile.d\conda.bat" + conda activate cadet-process + python -m unittest discover -s tests + shell: cmd /C call {0} - name: Install run: | pip install -e ./[testing]