Skip to content

use new micromamba 2.0.4 that exports pip packages (#186) #193

use new micromamba 2.0.4 that exports pip packages (#186)

use new micromamba 2.0.4 that exports pip packages (#186) #193

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-13, macos-latest ]
python-version: [ '3.10', '3.11', '3.12' ]
runs-on: ${{ matrix.runs-on }}
name: build (Python ${{ matrix.python-version }}, ${{ matrix.runs-on }})
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: mamba-org/setup-micromamba@06375d89d211a1232ef63355742e9e2e564bc7f7 # v2.0.2
with:
environment-name: stenv-${{ runner.os }}-py${{ matrix.python-version }}
environment-file: environment.yaml
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-downloads-key: downloads-${{ needs.date.outputs.date }}
cache-environment: true
cache-environment-key: environment-${{ needs.date.outputs.date }}
micromamba-version: '2.0.4-0'
init-shell: bash
generate-run-shell: false
- 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@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
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@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
with:
file: ${{ steps.output.outputs.filename }}