build: limit CI integration tests to relevant sections of the code. #3
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: integration tests | |
on: | |
push: | |
branches: | |
- "main" | |
- "feature/*" | |
- "hotfix/*" | |
- "release/*" | |
- "renovate/*" | |
pull_request: | |
paths-ignore: | |
- "tests/unit/**" | |
- "tests/integration/lxd/**" | |
- "craft_providers/lxd/**" | |
- "docs/**" | |
# Allows triggering the workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
enable_ssh_access: | |
type: boolean | |
description: 'Enable ssh access' | |
required: false | |
default: false | |
jobs: | |
integration-smoketests-macos: | |
strategy: | |
matrix: | |
python: ["3.11"] | |
runs-on: macos-latest | |
steps: | |
- name: Install Multipass | |
run: | | |
brew update | |
brew install multipass | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
- name: Configure environment | |
run: | | |
echo "::group::pip install" | |
python -m pip install 'tox>=4.6' | |
echo "::endgroup::" | |
echo "::group::Configure Multipass" | |
while ! multipass version | |
do | |
sleep 1 | |
done | |
echo "::endgroup::" | |
- name: Setup Tox environments | |
run: tox run --colored yes -e integration-smoketests-py${{ matrix.python }} --notest | |
- name: Enable ssh access | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ inputs.enable_ssh_access }} | |
with: | |
limit-access-to-actor: true | |
- name: Run integration smoketests on MacOS | |
env: | |
CRAFT_PROVIDERS_TESTS_ENABLE_MULTIPASS_INSTALL: 1 | |
CRAFT_PROVIDERS_TESTS_ENABLE_MULTIPASS_UNINSTALL: 1 | |
PYTEST_ADDOPTS: "--no-header -vv -rN" | |
run: | | |
.tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies --colored yes -e integration-smoketests-py${{ matrix.python }} |