build(deps): update github actions (main) #8032
This file contains hidden or 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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "feature/**" | |
| - "hotfix/**" | |
| paths-ignore: | |
| - .github/** | |
| - "!.github/workflows/tests.yaml" # Run on this file getting changed | |
| - docs/** | |
| - schema/** | |
| - tests/spread/** | |
| - .editorconfig | |
| - .pre-commit-config.yaml | |
| - .readthedocs.yaml | |
| - "*.md" # Only top-level Markdown files | |
| - spread.yaml | |
| pull_request: | |
| paths-ignore: | |
| - .github/** | |
| - "!.github/workflows/tests.yaml" # Run on this file getting changed | |
| - docs/** | |
| - schema/** | |
| - tests/spread/** | |
| - .editorconfig | |
| - .pre-commit-config.yaml | |
| - .readthedocs.yaml | |
| - "*.md" # Only top-level Markdown files | |
| - spread.yaml | |
| merge_group: | |
| paths-ignore: | |
| - .github/** | |
| - "!.github/workflows/tests.yaml" # Run on this file getting changed | |
| - docs/** | |
| - schema/** | |
| - tests/spread/** | |
| - .editorconfig | |
| - .pre-commit-config.yaml | |
| - .readthedocs.yaml | |
| - "*.md" # Only top-level Markdown files | |
| - spread.yaml | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| snap-build: | |
| runs-on: [self-hosted, amd64] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build snap | |
| uses: canonical/action-build@v1 | |
| id: snapcraft | |
| - name: Upload snap artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: snap | |
| path: ${{ steps.snapcraft.outputs.snap }} | |
| snap-publish: | |
| needs: [snap-build] | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request' }} | |
| steps: | |
| - name: Download snap artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: snap | |
| path: snap-artifacts | |
| - name: Get snap filename | |
| id: snap-name | |
| run: | | |
| echo "snap=$(find . -type f -name '*.snap')" >> $GITHUB_OUTPUT | |
| - name: Publish feature branch to edge/pr-${{ github.event.number }} | |
| if: env.SNAPCRAFT_STORE_CREDENTIALS != '' | |
| uses: canonical/action-publish@v1 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
| with: | |
| snap: ${{ steps.snap-name.outputs.snap }} | |
| release: edge/pr-${{ github.event.number }} | |
| macos-smoke-test: | |
| strategy: | |
| matrix: | |
| os: [macos-13, macos-14-large] | |
| 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@v4 | |
| 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 dependencies with homebrew | |
| run: | | |
| brew install multipass | |
| brew install [email protected] # For building pygit2 | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up uv with caching | |
| id: setup-uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| cache: "pip" | |
| - name: Build and install Charmcraft | |
| run: | | |
| uv sync --no-dev | |
| - name: Check for fully-configured multipass | |
| run: | | |
| while ! multipass version; do | |
| sleep 1 | |
| done | |
| - name: Init and pack | |
| run: | | |
| source .venv/bin/activate | |
| mkdir test-charm | |
| cd test-charm | |
| export CRAFT_VERBOSITY_LEVEL=trace | |
| charmcraft init --profile=machine | |
| charmcraft pack | |
| test -f *.charm |