Skip to content

Merge pull request #688 from maresb/faster-channel-inversion-test #181

Merge pull request #688 from maresb/faster-channel-inversion-test

Merge pull request #688 from maresb/faster-channel-inversion-test #181

Workflow file for this run

name: test
on:
pull_request:
push:
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
env:
MICROMAMBA_VERSION: 'latest'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.12" ]
defaults:
run:
shell: bash -eo pipefail -l {0}
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: ${{ env.MICROMAMBA_VERSION }}
environment-file: environments/conda-lock.yml
environment-name: conda-lock-dev
init-shell: bash
cache-environment: true
create-args: >-
python=${{ matrix.python-version }} --category=main --category=dev
- name: install conda-lock
run: |
which pip
pip install -e . --no-deps
pip check
- name: run-test
run: |
mkdir -p tests/durations
cp pyproject.toml "${RUNNER_TEMP}/"
cp -a tests "${RUNNER_TEMP}/"
pushd "${RUNNER_TEMP}"
export TMPDIR="${RUNNER_TEMP}"
ls -lah
set -x
which pytest
pytest \
--cov=conda_lock --cov-branch --cov-report=xml --cov-report=term \
--store-durations \
--durations-path "${{ github.workspace }}/tests/durations/${{ matrix.os }}-py${{ matrix.python-version }}.json" \
tests
cp coverage.xml "${{ github.workspace }}"
- uses: codecov/codecov-action@v4
- name: Print test durations
run: |
ls -al tests/durations
cat tests/durations/${{ matrix.os }}-py${{ matrix.python-version }}.json
- name: Store test durations
uses: actions/upload-artifact@v4
with:
name: test-durations-${{ matrix.os }}-py${{ matrix.python-version }}
path: tests/durations/${{ matrix.os }}-py${{ matrix.python-version }}.json