Display Python interpreter during CI #122
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: Build | |
on: push | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
container: ${{ matrix.container }} | |
name: ${{ matrix.container || matrix.os }}/${{ matrix.packaging }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# WARNING: requires odil ≥ 0.12.2 | |
# - { os: "ubuntu-latest", packaging: "apt", container: "debian:bullseye", python: "python3" } | |
- { os: "ubuntu-latest", packaging: "apt", container: "debian:bookworm", python: "python3" } | |
# - { os: "ubuntu-latest", packaging: "apt", container: "ubuntu:focal", python: "python3" } | |
# - { os: "ubuntu-latest", packaging: "apt", container: "ubuntu:jammy", python: "python3" } | |
- { os: "ubuntu-latest", packaging: "apt", container: "ubuntu:noble", python: "python3" } | |
- { os: "ubuntu-latest", packaging: "conda", python: "python" } | |
- { os: "macos-latest", packaging: "conda", python: "python" } | |
env: | |
WORKSPACE: "${{ github.workspace }}" | |
defaults: | |
run: | |
shell: ${{ contains(matrix.os, 'windows') && 'pwsh' || 'bash -l {0}' }} | |
steps: | |
- name: Provision (Debian, Ubuntu) | |
# Install Python and Git. macOS workers already have this, however for | |
# Linux we are running in minimal containers. | |
run: | | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y git python3 | |
if: ${{ contains(matrix.packaging, 'apt') }} | |
- name: Provision (Micromamba) | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
init-shell: bash powershell | |
environment-name: dicomifier | |
create-args: python=3.11 | |
if: ${{ contains(matrix.packaging, 'conda') }} | |
- name: Checkout latest revision | |
# Only the latest revision is required, as later steps do not depend on | |
# tags. | |
run: | | |
git config --global init.defaultBranch master | |
git config --global --add safe.directory '*' | |
git init . | |
git remote add origin ${{ github.server_url }}/${{ github.repository }} | |
git fetch origin --depth=1 ${{ github.ref }} | |
git checkout ${{ github.ref_name }} | |
- name: Set-up (${{ matrix.packaging }}) | |
run: | | |
echo "Python interpreters" | |
which -a ${{ matrix.python }} | |
${{ matrix.python }} .ci/build/${{ matrix.packaging }}.py | |
- name: Build | |
run: ${{ matrix.python }} ./.ci/build/build.py | |
- name: Run tests | |
run: ${{ matrix.python }} ./.ci/build/post_build.py |