Skip to content

Commit

Permalink
[WIP] Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
schmoelder committed Dec 9, 2023
1 parent bd721eb commit b054cdd
Showing 1 changed file with 55 additions and 34 deletions.
89 changes: 55 additions & 34 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,70 @@ on:
branches:
- master
- dev
- test_ci
pull_request:

jobs:
test-job:
runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]

env:
CONDA_FILE: environment.yml

steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 2
with:
path: ~/conda_pkgs_dir
key:
${{ matrix.os }}-python_${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/example-environment.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
use-mamba: true
auto-update-conda: true
channels: conda-forge,
- name: Install dependencies
run: |
mamba install cadet
pip install -e ./[testing]
- name: Test
run: |
python -m unittest discover -s tests
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build binary wheel and source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Test Wheel install and import
run: |
python -c "import CADETProcess; print(CADETProcess.__version__)"
- uses: actions/checkout@v4

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ${{ env.CONDA }}/envs
key: ${{ matrix.os }}-python_${{ matrix.python-version }}-${{ steps.get-date.outputs.today }}-${{ hashFiles(env.CONDA_FILE) }}-${{ env.CACHE_NUMBER }}

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
use-mamba: true
activate-environment: cadet-process
channels: conda-forge,

- name: Update environment
run: mamba env update -n cadet-process -f ${{ env.CONDA_FILE }}

- name: Install
run: |
pip install -e ./[testing]
- name: Test
run: |
python -m unittest discover -s tests
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build binary wheel and source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Test Wheel install and import
run: |
python -c "import CADETProcess; print(CADETProcess.__version__)"

0 comments on commit b054cdd

Please sign in to comment.