-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add release pipeline
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Release to latest/edge | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
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/[email protected] | ||
with: | ||
credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04 | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: python3 -m pip install tox | ||
- name: Run linters | ||
run: tox -e lint | ||
|
||
unit-test: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run tests | ||
run: tox -e unit | ||
|
||
security-test: | ||
name: Security tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run tests | ||
run: tox -e security | ||
|
||
integration-test: | ||
name: Integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup operator environment | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: microk8s | ||
# This is needed until https://bugs.launchpad.net/juju/+bug/1977582 is fixed | ||
bootstrap-options: "--agent-version 2.9.29" | ||
- name: Run integration tests | ||
run: tox -e integration | ||
|
||
release-to-charmhub: | ||
name: Release to CharmHub | ||
needs: | ||
- lib-check | ||
- lint | ||
- unit-test | ||
- security-test | ||
- integration-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Select charmhub channel | ||
uses: canonical/charming-actions/[email protected] | ||
id: channel | ||
- name: Upload charm to charmhub | ||
uses: canonical/charming-actions/[email protected] | ||
with: | ||
credentials: "${{ secrets.CHARMHUB_TOKEN }}" | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
channel: "${{ steps.channel.outputs.name }}" |