diff --git a/.github/workflows/charm-build.yaml b/.github/workflows/charm-build.yaml deleted file mode 100644 index 2d1391dbd..000000000 --- a/.github/workflows/charm-build.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Charm Build -on: - workflow_call: - workflow_dispatch: - -jobs: - build-charm: - runs-on: ubuntu-20.04 - strategy: - matrix: - charm-type: ["jimm","jimm-k8s"] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - run: git fetch --prune - - run: sudo snap install charmcraft --channel=2.x/stable --classic - - run: sudo charmcraft pack --project-dir ./charms/${{ matrix.charm-type }} --destructive-mode --verbosity=trace - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.charm-type }}-charm - path: ./*.charm - if-no-files-found: error diff --git a/.github/workflows/charm-release.yaml b/.github/workflows/charm-release.yaml deleted file mode 100644 index 8bd2537e2..000000000 --- a/.github/workflows/charm-release.yaml +++ /dev/null @@ -1,79 +0,0 @@ -name: Release to v3/edge - -on: - workflow_dispatch: - push: - tags: - - 'v3*' - -# Note this workflow requires a Github secret to provide auth against charmhub. -# This can be generated with the following command -# charmcraft login --export=secrets.auth --charm=juju-jimm --charm=juju-jimm-k8s --permission=package-manage --permission=package-view --channel=1/edge --channel=3/edge --ttl=999999999 - -jobs: - ci-tests: - uses: ./.github/workflows/ci.yaml - charm-tests: - uses: ./.github/workflows/charm-test.yaml - snap-build: - uses: ./.github/workflows/snap.yaml - - release-k8s-charm: - name: Release k8s charm - needs: - - ci-tests - - charm-tests - runs-on: ubuntu-20.04 - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'go.mod' - - name: Build local images - run: make jimm-image - - name: Upload charm to charmhub - uses: canonical/charming-actions/upload-charm@2.4.0 - with: - credentials: "${{ secrets.CHARMHUB_TOKEN }}" - github-token: "${{ secrets.GITHUB_TOKEN }}" - channel: "3/edge" - charm-path: "./charms/jimm-k8s" - pull-image: "false" - tag-prefix: "v3-k8s" - - release-machine-charm: - name: Release machine charm - needs: - - ci-tests - - charm-tests - - snap-build - runs-on: ubuntu-20.04 - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - uses: actions/download-artifact@master - with: - name: jimm-snap - - name: Install charmcraft - run: sudo snap install charmcraft --channel=2.x/stable --classic - - name: Publish Charm Resource - run: charmcraft upload-resource juju-jimm jimm-snap --filepath ./jimm.snap - env: - CHARMCRAFT_AUTH: "${{ secrets.CHARMHUB_TOKEN }}" - - name: Upload charm to charmhub - uses: canonical/charming-actions/upload-charm@2.3.0 - with: - credentials: "${{ secrets.CHARMHUB_TOKEN }}" - github-token: "${{ secrets.GITHUB_TOKEN }}" - channel: "3/edge" - charm-path: "./charms/jimm" - tag-prefix: "v3-machine" diff --git a/.github/workflows/charm-test.yaml b/.github/workflows/charm-test.yaml deleted file mode 100644 index a6398c089..000000000 --- a/.github/workflows/charm-test.yaml +++ /dev/null @@ -1,84 +0,0 @@ -name: Charm Test -on: - workflow_call: - workflow_dispatch: - pull_request: - paths: - - charms/** - -jobs: - charm-build: - uses: ./.github/workflows/charm-build.yaml - - lint: - name: Lint - runs-on: ubuntu-latest - strategy: - matrix: - charm-type: ["jimm","jimm-k8s"] - defaults: - run: - working-directory: ./charms/${{ matrix.charm-type }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - name: Install dependencies - run: python3 -m pip install tox - - name: Run linters - run: tox -e lint - unit-tests: - name: Unit tests - runs-on: ubuntu-latest - strategy: - matrix: - charm-type: ["jimm","jimm-k8s"] - defaults: - run: - working-directory: ./charms/${{ matrix.charm-type }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - name: Install dependencies - run: python -m pip install tox - - name: Run tests - run: tox -e unit - - integration-tests: - name: Integration tests - needs: - - charm-build - runs-on: ubuntu-latest - env: - charm-type: "jimm-k8s" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup operator environment - uses: charmed-kubernetes/actions-operator@main - with: - channel: 1.28-strict/stable - juju-channel: 3.4/stable - provider: microk8s - microk8s-group: snap_microk8s - microk8s-addons: "ingress hostpath-storage dns registry metallb:10.64.140.43/30" - # Download the charm from the build to speed up integration tests. - - uses: actions/download-artifact@v4 - with: - name: jimm-k8s-charm - path: ./charms/${{ env.charm-type }} - - name: Create OCI Image - run: make push-microk8s - - name: Install tox - run: python -m pip install tox - - name: Integration tests - run: tox -e integration -- --localCharm - working-directory: ./charms/${{ env.charm-type }} - - name: Dump logs - if: failure() - uses: canonical/charming-actions/dump-logs@main diff --git a/.github/workflows/jaas-snap-release.yaml b/.github/workflows/jaas-snap-release.yaml index 96a308c37..6a8517286 100644 --- a/.github/workflows/jaas-snap-release.yaml +++ b/.github/workflows/jaas-snap-release.yaml @@ -1,4 +1,4 @@ -name: Release jimmctl snap +name: Release jaas snap on: workflow_dispatch: diff --git a/.github/workflows/publich-oci.yaml b/.github/workflows/server-oci-release.yaml similarity index 82% rename from .github/workflows/publich-oci.yaml rename to .github/workflows/server-oci-release.yaml index 26c32f642..4c63ad394 100644 --- a/.github/workflows/publich-oci.yaml +++ b/.github/workflows/server-oci-release.yaml @@ -1,5 +1,5 @@ # Publish the OCI image to ghcr -name: Publish image +name: Publish server image on: # Note that when running via workflow_dispatch, the github.ref_name @@ -15,6 +15,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - run: git fetch --tags --force origin # https://github.com/actions/checkout/issues/882 & https://github.com/actions/checkout/issues/290 - name: Log in to the Container registry uses: docker/login-action@v3 diff --git a/.github/workflows/snap-release.yaml b/.github/workflows/snap-release.yaml index 00c1fd6e2..c3b704e92 100644 --- a/.github/workflows/snap-release.yaml +++ b/.github/workflows/snap-release.yaml @@ -24,13 +24,14 @@ jobs: with: fetch-depth: 0 fetch-tags: true - - name: scripts + - run: git fetch --tags --force origin # https://github.com/actions/checkout/issues/882 & https://github.com/actions/checkout/issues/290 + - name: Setup snap to build run: | mkdir -p ./snap cp ./snaps/${{ inputs.folder }}/snapcraft.yaml ./snap/ - uses: snapcore/action-build@v1 id: snapcraft - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: ${{ steps.snapcraft.outputs.snap }} path: ${{ steps.snapcraft.outputs.snap }} @@ -39,7 +40,7 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: ${{needs.build.outputs.snap}} - uses: snapcore/action-publish@v1