Skip to content

Use conda Python on macOS CI #118

Use conda Python on macOS CI

Use conda Python on macOS CI #118

Workflow file for this run

name: Build
on: push
defaults:
run:
shell: bash -i -l -e -o pipefail {0}
jobs:
build:
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
name: ${{ matrix.container || matrix.os }}
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: "macos-latest", packaging: "conda", python: "python" }
env:
WORKSPACE: "${{ github.workspace }}"
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.container, 'debian') || contains(matrix.container, 'ubuntu') }}
- name: Provision (macOS)
# Initialize the Conda environment by default
run: |
conda init --all
if: ${{ contains(matrix.os, 'macos') }}
- 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: ${{ 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