Skip to content

Commit

Permalink
Rework conda release test: big matrix, no tox involved
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Dec 18, 2024
1 parent 8a52a78 commit 10b56c0
Showing 1 changed file with 24 additions and 44 deletions.
68 changes: 24 additions & 44 deletions .github/workflows/test_release_conda.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test-release
name: Test Conda-forge release
on:
workflow_call:
inputs:
Expand All @@ -18,64 +18,44 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
python-version: [3.10, 3.11, 3.12]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure tags are fetched for versioning
- uses: actions/setup-python@v5
with:
python-version: |
3.10
3.11
3.12
- name: Install llvm on MacOS
if: startsWith(matrix.os, 'macos')
shell: bash -l {0}
env:
# Homebrew location is different on Intel Mac
LLVM_DIR: ${{ (matrix.os == 'macos-13') && '/usr/local/opt/llvm' || '/opt/homebrew/opt/llvm' }}
run: |
brew install llvm
echo CC="${LLVM_DIR}/bin/clang" >> $GITHUB_ENV
echo LDFLAGS="-L${LLVM_DIR}/lib $LDFLAGS" >> $GITHUB_ENV
echo CPPFLAGS="-I${LLVM_DIR}/include $CPPFLAGS" >> $GITHUB_ENV

- name: Windows - find MSVC and set environment variables
if: startsWith(matrix.os, 'windows')
shell: bash -l {0}
env:
MSVC_PREFIX: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC'
run: |
echo "Available MSVC installations:"
ls "$MSVC_PREFIX"
- name: Delete source (to be sure we are testing Conda package!)
run: rm -rf euphonic

MSVC_BIN=$(ls "$MSVC_PREFIX" | tail -n 1)\\bin\\HostX64\\x64
CC="$MSVC_PREFIX\\$MSVC_BIN\\cl.exe"
echo "CC: $CC"
echo "CC=$CC" >> $GITHUB_ENV
- uses: actions/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}

CC_LD="$MSVC_PREFIX\\$MSVC_BIN\\link.exe"
echo "CC_LD: $CC_LD"
echo "CC_LD=$CC_LD" >> $GITHUB_ENV
- name: Install euphonic and dependencies from Conda-forge
shell: bash -el {0}
env:
EUPHONIC_VERSION: ${{ inputs.version }}
EXTRA_PACKAGES: matplotlib-base pyyaml h5py
TESTING_PACKAGES: pytest=7.* coverage pytest-mock pytest-lazy-fixture pytest-xvfb python-slugify

- name: Update pip and install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r tests_and_analysis/ci_requirements.txt
conda install -c conda-forge euphonic=$EUPHONIC_VERSION $EXTRA_PACKAGES $TESTING_PACKAGES
# - name: Update pip and install testing dependencies
# shell: bash -l {0}
# run: |
# python -m pip install --upgrade pip
# python -m pip install -r tests_and_analysis/ci_requirements.txt

- name: Run tests
shell: bash -l {0}
env:
EUPHONIC_VERSION: ${{ github.event.inputs.version }}
run: python -m tox -c build_utils/release_tox.ini
shell: bash -el {0}
run: python tests_and_analysis/test/run_tests.py --report -m "not brille"

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Unit test results ${{ matrix.os }}
name: Unit test results ${{ matrix.os }} ${{ matrix.python-version }}
path: tests_and_analysis/test/reports/junit_report*.xml

publish-test-results:
Expand Down

0 comments on commit 10b56c0

Please sign in to comment.