fix: get non-store CI working on Charmcraft 2.7 #7227
Workflow file for this run
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: Spread | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 0 */2 * *" | |
| jobs: | |
| snap-build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build snap | |
| uses: snapcore/action-build@v1 | |
| id: charmcraft | |
| - name: Upload snap artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: snap | |
| path: ${{ steps.charmcraft.outputs.snap }} | |
| snap-tests: | |
| runs-on: [self-hosted, spread] | |
| needs: [snap-build] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| spread: | |
| - "google:" | |
| steps: | |
| - name: Cleanup job workspace | |
| run: | | |
| rm -rf "${{ github.workspace }}" | |
| mkdir "${{ github.workspace }}" | |
| - name: Checkout charmcraft | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - name: Download snap artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: snap | |
| - name: Run spread | |
| run: | | |
| spread ${{ matrix.spread }} | |
| snap-store-tests: | |
| runs-on: [self-hosted, spread] | |
| needs: [snap-build] | |
| steps: | |
| - name: Decision to Run | |
| id: decisions | |
| run: | | |
| # Secrets cannot be used in conditionals, so this is our dance: | |
| # https://github.com/actions/runner/issues/520 | |
| if [[ -n "${{ secrets.CHARMCRAFT_AUTH }}" ]]; then | |
| echo "::set-output name=RUN::true" | |
| else | |
| echo "::set-output name=RUN::" | |
| fi | |
| - if: steps.decisions.outputs.RUN == 'true' | |
| name: Cleanup job workspace | |
| run: | | |
| rm -rf "${{ github.workspace }}" | |
| mkdir "${{ github.workspace }}" | |
| - if: steps.decisions.outputs.RUN == 'true' | |
| name: Checkout charmcraft | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: true | |
| - if: steps.decisions.outputs.RUN == 'true' | |
| name: Download snap artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: snap | |
| - if: steps.decisions.outputs.RUN == 'true' | |
| name: Run spread | |
| env: | |
| CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }} | |
| CHARM_DEFAULT_NAME: gh-ci-charmcraft-charm | |
| BUNDLE_DEFAULT_NAME: gh-ci-charmcraft-bundle | |
| run: | | |
| spread google:ubuntu-22.04-64:tests/spread/store/ |