diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 5b42fb7..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,14 +0,0 @@ -on: - workflow_call: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: snapcore/action-build@v1 - id: snapcraft - - uses: actions/upload-artifact@v3 - with: - name: snap-artifact - path: ${{ steps.snapcraft.outputs.snap }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1df89b8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,47 @@ +# Copyright 2024 Canonical Ltd. +# See LICENSE file for licensing details. +name: Tests + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install tox + run: pipx install tox + - name: Run linters + run: tox run -e lint + + build: + name: Build snap + uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@v12.4.0 + + smoke: + name: Smoke test snap + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: + - lint + - build + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install tox + run: pipx install tox + - name: Download snap package(s) + uses: actions/download-artifact@v4 + with: + pattern: ${{ needs.build.outputs.artifact-prefix }}-* + merge-multiple: true + - name: Run tests + run: tox run -e smoke diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 449ffe6..0000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Lint -on: - pull_request: - workflow_call: - workflow_dispatch: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Install tox - run: python3 -m pip install tox - - name: YAML Lint - run: tox -e lint diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 6682111..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,28 +0,0 @@ -on: - push: - branches: - - '[0-9]+/[a-z]+' - workflow_call: - workflow_dispatch: - -jobs: - build: - uses: ./.github/workflows/build.yaml - publish: - name: Publish Snap - runs-on: ubuntu-latest - needs: build - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: snap-artifact - - id: get-snap-name - run: echo "SNAP_FILE=$(ls *.snap)" >> $GITHUB_OUTPUT - - uses: snapcore/action-publish@v1 - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} - with: - snap: ${{ steps.get-snap-name.outputs.SNAP_FILE }} - release: ${{ github.ref_name }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..b2d47ba --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +# Copyright 2024 Canonical Ltd. +# See LICENSE file for licensing details. +name: Release to Snap Store + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - 14/edge + +jobs: + build: + name: Build snap + uses: canonical/data-platform-workflows/.github/workflows/build_snap.yaml@v12.4.0 + + release: + name: Release snap + needs: + - build + uses: canonical/data-platform-workflows/.github/workflows/release_snap.yaml@v12.4.0 + with: + channel: 14/edge + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + secrets: + snap-store-token: ${{ secrets.SNAP_STORE_TOKEN }} + permissions: + contents: write # Needed to create GitHub release diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml deleted file mode 100644 index 846cebc..0000000 --- a/.github/workflows/smoke.yaml +++ /dev/null @@ -1,22 +0,0 @@ -on: - pull_request: - workflow_dispatch: - workflow_call: - -jobs: - build: - name: Build Snap - uses: ./.github/workflows/build.yaml - smoke: - name: Smoke Tests - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: snap-artifact - - name: Install tox - run: python3 -m pip install tox - - name: Smoke Tests - run: tox -e smoke diff --git a/.github/workflows/sync_issue_to_jira.yaml b/.github/workflows/sync_issue_to_jira.yaml index ec877b3..5715635 100644 --- a/.github/workflows/sync_issue_to_jira.yaml +++ b/.github/workflows/sync_issue_to_jira.yaml @@ -9,7 +9,7 @@ on: jobs: sync: name: Sync GitHub issue to Jira - uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v2 + uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v12 with: jira-base-url: https://warthogs.atlassian.net jira-project-key: DPE