Collect test duration data for various runner configurations #1730
Workflow file for this run
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: 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 -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 | |
shell: bash -eo pipefail -l {0} | |
run: | | |
which pip | |
pip install -e . --no-deps | |
pip check | |
- name: run-test | |
shell: bash -eo pipefail -l {0} | |
run: | | |
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 | |
shell: bash -l {0} | |
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 |