Skip to content

Commit

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

jobs:

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

lint:
name: Lint Check
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 983aceb

Please sign in to comment.