generated from canonical/template-operator
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflows adopted for Juju3 secrets testing
- Loading branch information
1 parent
24a01d5
commit 7e029d2
Showing
5 changed files
with
156 additions
and
24 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,80 @@ | ||
# Copyright 2023 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
on: | ||
workflow_call: | ||
inputs: | ||
juju-snap-channel: | ||
description: Snap channel for Juju CLI | ||
default: 3.1/stable | ||
type: string | ||
libjuju-version-specifier: | ||
description: | | ||
python-libjuju version specifier (e.g. ">=1.3") | ||
https://packaging.python.org/en/latest/glossary/#term-Version-Specifier | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
build: | ||
name: Build charms | ||
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2 | ||
|
||
integration-test: | ||
needs: | ||
- build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tox-environments: | ||
- charm-integration | ||
- tls-integration | ||
- client-integration | ||
runner: ["ubuntu-22.04"] | ||
name: ${{ matrix.tox-environments }} | ||
runs-on: ${{ matrix.runner }} | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Juju environment | ||
# Runs on juju 3 by default | ||
# TODO: Replace with custom image on self-hosted runner | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: lxd | ||
juju-channel: ${{ inputs.juju-snap-channel }} | ||
|
||
- name: Download packed charm(s) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ needs.build.outputs.artifact-name }} | ||
|
||
- name: Select tests | ||
id: select-tests | ||
run: | | ||
if [ "${{ github.event_name }}" == "schedule" ] | ||
then | ||
echo Running unstable and stable tests | ||
echo "mark_expression=" >> $GITHUB_OUTPUT | ||
else | ||
echo Skipping unstable tests | ||
echo "mark_expression=not unstable" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run integration tests | ||
run: | | ||
# free space in the runner | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /usr/local/share/boost | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
# Set kernel params | ||
sudo sysctl -w vm.max_map_count=262144 vm.swappiness=0 net.ipv4.tcp_retries2=5 | ||
tox run -e ${{ matrix.tox-environments }} -- -m '${{ steps.select-tests.outputs.mark_expression }}' | ||
env: | ||
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }} | ||
LIBJUJU_VERSION_SPECIFIER: ${{ inputs.libjuju-version-specifier }} | ||
- name: Print logs | ||
run: juju switch testing; juju debug-log --replay --no-tail |
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
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,44 @@ | ||
# Copyright 2023 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
name: Pre-integration checks | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
libjuju-version-specifier: | ||
description: | | ||
python-libjuju version specifier (e.g. ">=1.3") | ||
https://packaging.python.org/en/latest/glossary/#term-Version-Specifier | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install tox | ||
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version | ||
run: python3 -m pip install tox | ||
- name: Run linters | ||
run: tox run -e lint | ||
|
||
unit-test-juju3: | ||
name: Unit tests Juju 3 | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 5 | ||
needs: | ||
- lint | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install tox | ||
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version | ||
run: python3 -m pip install tox | ||
- name: Run tests | ||
run: tox run -e unit-secrets-juju3 | ||
env: | ||
LIBJUJU_VERSION_SPECIFIER: ${{ inputs.libjuju-version-specifier }} |
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
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