Skip to content

Commit

Permalink
reuse ci (canonical#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
beliaev-maksim authored Mar 27, 2023
1 parent beb4771 commit ceca1b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,21 @@ name: CI
on:
workflow_call:
secrets:
charmcraft-credentials:
CHARMCRAFT_CREDENTIALS:
required: true

jobs:

lib-check:
name: Check libraries
runs-on: ubuntu-20.04
strategy:
matrix:
charm:
- jupyter-controller
- jupyter-ui
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/check-libraries@2.2.2
with:
uses: canonical/charmed-kubeflow-workflows/.github/workflows/_quality-checks.yaml@main
secrets: inherit
with:
charm-path: ./charms/${{ matrix.charm }}
credentials: "${{ secrets.charmcraft-credentials }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"

unit:
name: Unit Test
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ jobs:
tests:
name: Run Tests
uses: ./.github/workflows/integrate.yaml
secrets:
charmcraft-credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
secrets: inherit

# publish runs in parallel with tests, as we always publish in this situation
publish-charm:
name: Publish Charm
uses: ./.github/workflows/publish.yaml
secrets:
CHARMCRAFT_CREDENTIALS: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
secrets: inherit

10 changes: 4 additions & 6 deletions .github/workflows/on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: On Push
# On push to a "special" branch, we:
# * always publish to charmhub at latest/edge/branchname
# * always run tests
# where a "special" branch is one of main/master or track/**, as
# where a "special" branch is one of main or track/**, as
# by convention these branches are the source for a corresponding
# charmhub edge channel.

on:
push:
branches:
- master
- main
- track/**

Expand All @@ -19,13 +18,12 @@ jobs:
tests:
name: Run Tests
uses: ./.github/workflows/integrate.yaml
secrets:
charmcraft-credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
secrets: inherit

# publish runs in series with tests, and only publishes if tests passes
publish-charm:
name: Publish Charm
needs: tests
uses: ./.github/workflows/publish.yaml
secrets:
CHARMCRAFT_CREDENTIALS: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
secrets: inherit

0 comments on commit ceca1b0

Please sign in to comment.