From 30f82381f2a7d88ad1bfdec0b947e4efc9d62f8e Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Sun, 24 Mar 2024 21:12:45 -0600 Subject: [PATCH] ci/cirrus: experiment --- .cirrus.yml | 59 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0ca40e5825e..1fa92c092fb 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,33 +3,40 @@ freebsd_instance: cpu: 2 memory: 4G -test_task: - name: "Tests / FreeBSD / " +env: + # `SHELL` environment variable is not set by default, so we explicitly set it to + # avoid failures on tests that depend on it. + SHELL: sh + +tests_task: only_if: $CIRRUS_TAG == '' skip: "!changesInclude('.cirrus.yml', 'poetry.lock', 'pyproject.toml', 'src/**.py', 'tests/**')" env: - # `SHELL` environment variable is not set by default, so we explicitly set it to - # avoid failures on tests that depend on it. - SHELL: sh - matrix: - - PYTHON: python3.8 - - PYTHON: python3.9 - - PYTHON: python3.10 - - PYTHON: python3.11 - install_prereqs_script: + PY: + matrix: + - 3.8 + - 3.9 + - 3.10 + - 3.11 + bootstrap_poetry_script: - V=$(printf '%s' $PYTHON | tr -d '.[:alpha:]') - - pkg install -y python${V} py${V}-sqlite3 - install_poetry_script: - - POETRY_HOME=/opt/poetry - - $PYTHON -m venv $POETRY_HOME - - $POETRY_HOME/bin/pip install --upgrade pip setuptools wheel - - $POETRY_HOME/bin/pip install poetry - - echo "PATH=$POETRY_HOME/bin:$PATH" >> $CIRRUS_ENV - install_and_test_script: - - poetry install - - poetry run pytest --junitxml=junit.xml -v - on_failure: - annotate_failure_artifacts: - path: junit.xml - format: junit - type: text/xml + - pkg install -y python${V} py${V}-sqlite3 devel/py-pipx + - pipx ensurepath + - pipx install poetry + setup_environment_script: + # - ln -sf /usr/local/local/bin/python${PY} /usr/local/bin/python + - poetry install --sync + - poetry env info + - poetry show + matrix: + - name: "Tests / pytest [FreeBSD / Python ${PY}]" + pytest_script: + - poetry run pytest --integration -v --junitxml=junit.xml + on_failure: + annotate_failure_artifacts: + path: junit.xml + format: junit + type: text/xml + - name: "Tests / mypy [FreeBSD / Python ${PY}]" + mypy_script: + - poetry run mypy