Skip to content

ci: update workflows #186

ci: update workflows

ci: update workflows #186

Workflow file for this run

name: Build and Test with Mamba
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Update environment.yaml with Python ${{ matrix.python-version }}
run: |
sed -i "s/- python=3.9/- python=${{ matrix.python-version }}/" environment.yaml
cat environment.yaml
- name: Set up Micromamba
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: environment.yaml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
- name: Install dependencies
shell: bash -l {0}
run: |
uv pip install -e .
- name: Cache build artifacts
uses: actions/cache@v3
with:
path: |
~/.cache/pip
.micromamba/envs/mattersim
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ hashFiles('**/environment.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.python-version }}-
test:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Restore build artifacts
uses: actions/cache@v3
with:
path: |
~/.cache/pip
.micromamba/envs/mattersim
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ hashFiles('**/environment.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.python-version }}-
- name: Set up Micromamba
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: 'latest'
environment-file: environment.yaml
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
- name: Install test dependencies
shell: bash -l {0}
run: |
uv pip install -e ".[dev]"
- name: Run tests
run: |
pytest -s tests