From 6f337aa84c5bd775191a34d1485f4f6614199923 Mon Sep 17 00:00:00 2001 From: Alex Lowe Date: Mon, 19 Aug 2024 09:31:39 -0400 Subject: [PATCH] ci(macos): add a macos init/pack smoke test (#1823) Fixes #1767, depends on #1822 --- .github/workflows/tests.yaml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index caaca6885..faba8a89d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -284,3 +284,50 @@ jobs: path: | dist\charmcraft-installer-self-signed.exe dist\charmcraft-installer.msix + + macos-smoke-test: + strategy: + matrix: + os: [macos-12, macos-13] + runs-on: ${{ matrix.os }} + steps: + # Installing and caching homebrew using the action should speed up subsequent CI: + # https://github.com/Homebrew/actions/tree/master/setup-homebrew + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + - name: Cache Homebrew Bundler RubyGems + id: cache + uses: actions/cache@v3 + with: + path: ${{ steps.set-up-homebrew.outputs.gems-path }} + key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} + restore-keys: ${{ runner.os }}-rubygems- + - name: Install Homebrew Bundler RubyGems + if: steps.cache.outputs.cache-hit != 'true' + run: brew install-bundler-gems + - name: Install Multipass + run: | + brew install multipass + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - name: Build and install Charmcraft + run: | + pipx install . + - name: Check for fully-configured multipass + run: | + while ! multipass version; do + sleep 1 + done + - name: Init and pack + run: | + mkdir test-charm + cd test-charm + export CRAFT_VERBOSITY_LEVEL=trace + charmcraft init --profile=machine + charmcraft pack