diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 643225393..97c75417d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,6 +2,9 @@ name: Tests on: pull_request: workflow_call: + secrets: + CHARMHUB_TOKEN: + required: true jobs: lint: @@ -9,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: python3 -m pip install tox - name: Run linters @@ -20,21 +23,36 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: python -m pip install tox - name: Run tests run: tox -e unit + lib-check: + name: Check libraries + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Check libs + uses: canonical/charming-actions/check-libraries@2.1.1 + with: + credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04 + github-token: "${{ secrets.GITHUB_TOKEN }}" + charm-integration-test-lxd: name: Charm integration tests (lxd) needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -47,10 +65,11 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -63,10 +82,11 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -79,10 +99,11 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -95,27 +116,14 @@ jobs: needs: - lint - unit-test + - lib-check runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: provider: lxd - name: Run tls integration tests run: tox -e tls-integration - - lib-check: - name: Check libraries - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Check libs - uses: canonical/charming-actions/check-libraries@1.0.3 - with: - credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04 - github-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 632357693..8a2ba64c9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,23 +8,21 @@ on: jobs: ci-tests: uses: ./.github/workflows/ci.yaml + secrets: + CHARMHUB_TOKEN: "${{ secrets.CHARMHUB_TOKEN }}" release-to-charmhub: name: Release to CharmHub needs: - - lib-check - ci-tests runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Select charmhub channel - uses: canonical/charming-actions/upload-charm@2.1.0-rc - id: channel - name: Upload charm to charmhub - uses: canonical/charming-actions/upload-charm@2.0.0-rc + uses: canonical/charming-actions/upload-charm@2.1.1 with: credentials: "${{ secrets.CHARMHUB_TOKEN }}" github-token: "${{ secrets.GITHUB_TOKEN }}"