From 1f06e0d43d70469a2eead34835d58bec68edb2e4 Mon Sep 17 00:00:00 2001 From: Maksim Beliaev Date: Mon, 27 Mar 2023 10:15:27 +0200 Subject: [PATCH] reuse ci (#55) --- .github/workflows/integrate.yaml | 18 +++++------------- .github/workflows/on_pull_request.yaml | 6 ++---- .github/workflows/on_push.yaml | 9 +++------ 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 759ee3f..f111e7c 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -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@v3 - with: - fetch-depth: 0 - - name: Check libs - uses: canonical/charming-actions/check-libraries@2.2.3 - 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 diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index aabbaf7..3d7eef1 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -12,12 +12,10 @@ 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 diff --git a/.github/workflows/on_push.yaml b/.github/workflows/on_push.yaml index 3ccfb28..31c42da 100644 --- a/.github/workflows/on_push.yaml +++ b/.github/workflows/on_push.yaml @@ -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/** @@ -19,13 +18,11 @@ 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