Skip to content

move dependencies into pip packages (#214) #267

move dependencies into pip packages (#214)

move dependencies into pip packages (#214) #267

Workflow file for this run

name: build
on:
workflow_call:
outputs:
date:
value: ${{ jobs.date.outputs.date }}
workflow_dispatch:
push:
release:
types:
- published
concurrency:
group: build-${{ github.ref }}
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
date:
runs-on: ubuntu-latest
steps:
- run: echo date="$(date +%Y.%m.%d)" >> $GITHUB_OUTPUT
id: date
outputs:
date: ${{ steps.date.outputs.date }}
build:
needs: [ date ]
strategy:
fail-fast: false
matrix:
# the macOS 13 runner is on Intel hardware
runs-on: [ ubuntu-latest, macos-latest ]
python-version: [ '3.11', '3.12', '3.13' ]
runs-on: ${{ matrix.runs-on }}
name: build (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: mamba-org/setup-micromamba@add3a49764cedee8ee24e82dfde87f5bc2914462 # v2.0.7
with:
environment-name: stenv-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yaml
condarc: |
use_uv: true
create-args: >-
python=${{ matrix.python-version }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
init-shell: bash
generate-run-shell: false
post-cleanup: none
- run: echo "filename=stenv-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ needs.date.outputs.date }}.yaml" >> $GITHUB_OUTPUT
id: output
- run: |
micromamba env export --no-build | grep -v "name:" | grep -v "prefix:" > ${{ steps.output.outputs.filename }}
cat ${{ steps.output.outputs.filename }}
- run: pip install pytest
- run: pytest tests/test_import.py
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ steps.output.outputs.filename }}
path: ${{ steps.output.outputs.filename }}
- if: (github.event_name == 'release' && github.event.action == 'published')
uses: svenstaro/upload-release-action@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 # 2.11.2
with:
file: ${{ steps.output.outputs.filename }}