Run CI on defaults
too
#238
Workflow file for this run
This file contains hidden or 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: conda-self tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
# Concurrency group that uses the workflow name and PR number if available | |
# or commit SHA as a fallback. If a new build is triggered under that | |
# concurrency group while a previous build is running it will be canceled. | |
# Repeated pushes to a PR will cancel all previous builds, while multiple | |
# merges to main will not cancel. | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: ${{ matrix.os }}, py${{ matrix.python-version }}, ${{ matrix.channel }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
channel: [defaults, conda-forge] | |
python-version: ["39", "310", "311", "312"] | |
include: | |
- os: macos-13 | |
channel: defaults | |
python-version: "39" | |
- os: macos-14 | |
channel: conda-forge | |
python-version: "312" | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Patch channels in pixi config | |
if: matrix.channel == 'defaults' | |
shell: bash | |
run: | | |
sed -i.bak 's|channels = \["conda-forge"\]|channels = ["https://repo.anaconda.com/pkgs/main", "https://repo.anaconda.com/pkgs/r", "https://repo.anaconda.com/pkgs/msys2"]|g' pyproject.toml | |
rm pixi.lock | |
- uses: prefix-dev/setup-pixi@fef5c9568ca6c4ff7707bf840ab0692ba3f08293 # v0.9.0 | |
with: | |
environments: test-py${{ matrix.python-version }} | |
- name: Ensure package is installed | |
run: pixi reinstall --environment test-py${{ matrix.python-version }} conda-self | |
- name: Setup project | |
run: | | |
echo "channels: [${{ matrix.channel }}]" > .pixi/envs/test-py${{ matrix.python-version }}/.condarc | |
pixi run --environment test-py${{ matrix.python-version }} python -m conda info | |
- name: Run tests | |
run: pixi run --environment test-py${{ matrix.python-version }} test --basetemp=${{ runner.os == 'Windows' && 'D:\temp' || runner.temp }} | |
build-conda: | |
name: Build conda package (${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
env: | |
PYTHONUNBUFFERED: "1" | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
with: | |
fetch-depth: 0 | |
- uses: prefix-dev/setup-pixi@fef5c9568ca6c4ff7707bf840ab0692ba3f08293 # v0.9.0 | |
with: | |
environments: build | |
- name: Build recipe | |
run: pixi run --environment build build |