Merge pull request #15 from ubuntu/skia/retracer_privatetmp #132
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: Build and test charm | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| with: | |
| persist-credentials: false | |
| - name: Install dependencies | |
| run: sudo snap install ruff --classic | |
| - name: Run linters | |
| run: ruff check --preview . | |
| working-directory: charm | |
| lib-check: | |
| name: Check libraries | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| with: | |
| # fetch-depth: 0 # TODO optimize that for speed | |
| persist-credentials: false | |
| - name: Check libs | |
| uses: canonical/charming-actions/check-libraries@1753e0803f70445132e92acd45c905aba6473225 # 2.7.0 | |
| with: | |
| github-token: "${{ secrets.GITHUB_TOKEN }}" | |
| charm-path: . | |
| pack-charm: | |
| name: Build charm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: Hyask/free-disk-space@4f025bdd96db60187593b61863469bfc94c97833 # v1.3.1+apt-get-quiet | |
| # uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | |
| with: | |
| tool-cache: true # We don't need any pre-cached tools | |
| large-packages: false # Not so much disk gained for too long runtime | |
| - name: Checkout | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| with: | |
| persist-credentials: false | |
| - name: Setup LXD | |
| uses: canonical/setup-lxd@a3c85fc6fb7fff43fcfeae87659e41a8f635b7dd | |
| - name: Install ~~charmcraft~~spread | |
| run: sudo snap install charmcraft --classic | |
| - name: Pack charm | |
| run: charmcraft pack -v | |
| - name: Run charm tests | |
| run: | | |
| charmcraft.spread -v charm/tests/ | |
| - name: Upload charm artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: error-tracker.charm | |
| path: "*.charm" | |
| - name: Upload charm to charmhub | |
| uses: canonical/charming-actions/upload-charm@1753e0803f70445132e92acd45c905aba6473225 # 2.7.0 | |
| with: | |
| credentials: '${{ secrets.CHARMHUB_TOKEN }}' | |
| github-token: '${{ secrets.GITHUB_TOKEN }}' | |
| tag-prefix: error-tracker | |
| built-charm-path: error-tracker_ubuntu@24.04-amd64.charm | |
| if: github.ref == 'refs/heads/main' |