diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 81ee61aa6..061dd19ff 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -63,9 +63,13 @@ jobs: if: ${{ startsWith(matrix.os, 'ubuntu') }} run: | sudo apt update - sudo apt install -y python3-pip python3-setuptools python3-wheel python3-venv libapt-pkg-dev skopeo + sudo apt install -y python3-pip python3-setuptools python3-wheel python3-venv libapt-pkg-dev export $(cat /etc/os-release | grep VERSION_CODENAME) pip install -U -r "requirements-${VERSION_CODENAME}.txt" + - name: Install external dependencies with homebrew + if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }} + run: | + brew install skopeo - name: Configure environment run: | python -m pip install tox diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 86c1c096b..2fcc542f7 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -155,7 +155,7 @@ parts: skopeo: # Copied from Rockcraft plugin: nil source: https://github.com/containers/skopeo.git - source-tag: v1.14.2 + source-tag: v1.15.1 override-build: | CGO=1 go build -ldflags -linkmode=external ./cmd/skopeo mkdir "$CRAFT_PART_INSTALL"/bin diff --git a/tests/unit/utils/test_skopeo.py b/tests/unit/utils/test_skopeo.py index aa4061dc1..af2c6668d 100644 --- a/tests/unit/utils/test_skopeo.py +++ b/tests/unit/utils/test_skopeo.py @@ -16,12 +16,21 @@ """Unit tests for skopeo wrapper.""" import pathlib +import platform from unittest import mock import pytest from charmcraft.utils.skopeo import Skopeo +pytestmark = [ + pytest.mark.xfail( + platform.system().lower() not in ("linux", "darwin"), + reason="Don't necessarily have skopeo on non Linux/mac platforms.", + strict=False, # Allow them to pass anyway. + ), +] + IMAGE_PATHS = [ # See: https://github.com/containers/skopeo/blob/main/docs/skopeo.1.md#image-names "containers-storage:my/local:image", "dir:/tmp/some-dir",