Test the Windows CI on dev #1397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pipeline | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
- test_ci | |
pull_request: | |
jobs: | |
test-job: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
matrix: | |
#os: [ubuntu-latest] | |
#python-version: ["3.10", "3.11", "3.12"] | |
include: | |
- os: windows-latest | |
python-version: "3.12" | |
# - os: macos-13 | |
# python-version: "3.12" | |
env: | |
CONDA_FILE: environment.yml | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Date | |
id: get-date | |
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
shell: bash -el {0} | |
- name: Setup Miniconda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniforge-version: latest | |
use-mamba: true | |
auto-activate-base: false | |
use-only-tar-bz2: true # Enable for caching compatibility on Windows | |
channels: conda-forge | |
# Cache Conda Environments | |
- name: Cache conda | |
uses: actions/cache@v4 | |
with: | |
path: $CONDA_PREFIX/envs | |
key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }} | |
restore-keys: ${{ runner.os }}-python_${{ matrix.python-version }} | |
# Update Environment | |
- name: Update Environment | |
shell: bash -el {0} | |
run: | | |
source $CONDA/etc/profile.d/conda.sh | |
mamba install -n base "setuptools>=69" "pip>=24" | |
mamba install -n base python=${{ matrix.python-version }} | |
echo "python=${{ matrix.python-version }}.*" > $CONDA_PREFIX/conda-meta/pinned | |
mamba env update -n cadet-process -f ${{ env.CONDA_FILE }} | |
# Install Dependencies | |
- name: Install Dependencies | |
shell: bash -el {0} | |
run: | | |
source $CONDA/etc/profile.d/conda.sh | |
mamba activate cadet-process | |
mamba run pip install -e ./[testing] | |
# Run Tests | |
- name: Run Tests | |
shell: bash -el {0} | |
run: | | |
mamba activate cadet-process | |
mamba run python -m unittest discover -s tests | |
# Build Artifacts | |
- name: Build Artifacts | |
shell: bash -el {0} | |
run: | | |
mamba activate cadet-process | |
mamba run python -m pip install build --user | |
mamba run python -m build --sdist --wheel --outdir dist/ | |
# Test Artifacts | |
- name: Test Artifacts | |
shell: bash -el {0} | |
run: | | |
mamba activate cadet-process | |
mamba run pip install dist/*.whl | |
mamba run python -c "import CADETProcess; print(CADETProcess.__version__)" |