DEBUG: run conda job on fork #63
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: macOS tests (meson) | |
on: | |
push: | |
branches: | |
- ci-conda-py312-tst | |
pull_request: | |
branches: | |
- main | |
- maintenance/** | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
env: | |
CCACHE_DIR: "${{ github.workspace }}/.ccache" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
x86_conda: | |
name: macOS x86-64 conda | |
# To enable this workflow on a fork, comment out: | |
runs-on: macos-13 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: recursive | |
fetch-tags: true | |
- name: Prepare cache dirs and timestamps | |
id: prep-ccache | |
shell: bash -l {0} | |
run: | | |
mkdir -p "${CCACHE_DIR}" | |
echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT | |
NOW=$(date -u +"%F-%T") | |
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT | |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Setup compiler cache | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
id: cache-ccache | |
with: | |
path: ${{ steps.prep-ccache.outputs.dir }} | |
key: ${{ github.workflow }}-${{ matrix.python-version }}-ccache-macos-${{ steps.prep-ccache.outputs.timestamp }} | |
restore-keys: | | |
${{ github.workflow }}-${{ matrix.python-version }}-ccache-macos- | |
- name: Setup Miniforge | |
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3.0.4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
channel-priority: true | |
activate-environment: numpy-dev | |
use-only-tar-bz2: false | |
miniforge-variant: Miniforge3 | |
miniforge-version: latest | |
use-mamba: true | |
# Updates if `environment.yml` or the date changes. The latter is needed to | |
# ensure we re-solve once a day (since we don't lock versions). Could be | |
# replaced by a conda-lock based approach in the future. | |
- name: Cache conda environment | |
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1 | |
env: | |
# Increase this value to reset cache if environment.yml has not changed | |
CACHE_NUMBER: 1 | |
with: | |
path: ${{ env.CONDA }}/envs/numpy-dev | |
key: | |
${{ runner.os }}--${{ steps.prep-ccache.outputs.today }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | |
id: envcache | |
- name: Update Conda Environment | |
run: mamba env update -n numpy-dev -f environment.yml | |
if: steps.envcache.outputs.cache-hit != 'true' | |
- name: Build and Install NumPy | |
shell: bash -l {0} | |
run: | | |
conda activate numpy-dev | |
CC="ccache $CC" spin build -j2 -- -Dallow-noblas=false | |
- name: Run test suite (full) | |
shell: bash -l {0} | |
run: | | |
conda activate numpy-dev | |
export OMP_NUM_THREADS=2 | |
spin test -j2 -m full | |
- name: Ccache statistics | |
shell: bash -l {0} | |
run: | | |
conda activate numpy-dev | |
ccache -s | |
accelerate: | |
name: Accelerate (LP64, ILP64) - ${{ matrix.build_runner[1] }} | |
if: github.repository == 'numpy/numpy' | |
runs-on: ${{ matrix.build_runner[0] }} | |
strategy: | |
fail-fast: false | |
matrix: | |
build_runner: | |
- [ macos-13, "macos_x86_64" ] | |
- [ macos-14, "macos_arm64" ] | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
submodules: recursive | |
fetch-tags: true | |
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 | |
with: | |
python-version: '3.10' | |
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
if: ${{ matrix.build_runner[0] == 'macos-13' }} | |
with: | |
xcode-version: '14.3' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements/build_requirements.txt | |
pip install pytest pytest-xdist hypothesis | |
- name: Build against Accelerate (LP64) | |
run: spin build -- -Ddisable-optimization=true -Dallow-noblas=false | |
- name: Test (linalg only) | |
run: spin test -j2 -- numpy/linalg | |
- name: Build NumPy against Accelerate (ILP64) | |
run: | | |
git clean -xdf | |
spin build -- -Duse-ilp64=true -Ddisable-optimization=true -Dallow-noblas=false | |
- name: Test (fast tests) | |
run: spin test -j2 |