-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DPE-2789] update data-platform-workflows #263
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2081dd6
Tweak workflows
dragomirp f3a4640
Merge branch 'main' into dpe-2789-update-dpw
dragomirp 27497c5
Initial pass
dragomirp 6a616e7
Merge branch 'main' into dpe-2789-update-dpw
dragomirp 77eb3ae
Tweak conftest
dragomirp 4f0941c
Move renovate configs
dragomirp 36dea88
Add wrapper
dragomirp 4fa5914
Copy from mysql-k8s
dragomirp 63a8f06
Merge branch 'main' into dpe-2789-update-dpw
dragomirp 6dcc0ab
Linting
dragomirp bf0e086
Partial merge
dragomirp 422c8d0
Saner marks
dragomirp 49e8f80
Tweak excludes
dragomirp bc992fc
Bump dpw version
dragomirp 6eaa292
Bump deps
dragomirp df36e8b
Tweak backup tests
dragomirp c4f72d2
Conditional free space
dragomirp dc44a1b
Revert "Conditional free space"
dragomirp fc9bcbc
Bump jira sync version
dragomirp e2b0810
Bump lock
dragomirp 38f244e
Remove schedule and call
dragomirp a9f3330
Bump libs and actions
dragomirp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,16 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"], | ||
"reviewers": ["dragomirp", "marceloneppel", "taurus-forever"], | ||
"packageRules": [ | ||
// Later rules override earlier rules | ||
], | ||
"regexManagers": [ | ||
{ | ||
"fileMatch": ["(^|/)([\\w-]*)charmcraft\\.ya?ml$"], | ||
"matchStrings": ["- (?<depName>.*?)(?:\\[.*?\\])?==(?<currentValue>.*?) +# renovate"], | ||
"datasourceTemplate": "pypi", | ||
"versioningTemplate": "loose" | ||
} | ||
] | ||
} |
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 |
---|---|---|
|
@@ -22,45 +22,40 @@ on: | |
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
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 | ||
uses: canonical/data-platform-workflows/.github/workflows/[email protected] | ||
|
||
unit-test: | ||
name: Unit tests | ||
name: Unit test charm | ||
runs-on: ubuntu-latest | ||
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 | ||
uses: actions/checkout@v4 | ||
- name: Install tox & poetry | ||
run: | | ||
pipx install tox | ||
pipx install poetry | ||
- name: Run tests | ||
run: tox run -e unit | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
|
||
build: | ||
name: Build charms | ||
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2 | ||
name: Build charm | ||
uses: canonical/data-platform-workflows/.github/workflows/[email protected] | ||
permissions: | ||
actions: write # Needed to manage GitHub Actions cache | ||
|
||
integration-test: | ||
gh-hosted-integration-test: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 6 | ||
matrix: | ||
tox-environments: | ||
tox-environment: | ||
- backup-integration | ||
- charm-integration | ||
- database-relation-integration | ||
- db-relation-integration | ||
- db-admin-relation-integration | ||
- ha-replication-integration | ||
- ha-self-healing-integration | ||
- ha-restore-cluster-integration | ||
|
@@ -69,22 +64,21 @@ jobs: | |
- tls-integration | ||
- upgrade-integration | ||
- upgrade-from-stable-integration | ||
agent-versions: | ||
- "2.9.45" # renovate: latest juju 2 | ||
- "3.1.6" # renovate: latest juju 3 | ||
free-disk-space: | ||
- false | ||
juju-snap-channel: ["2.9/stable", "3.1/stable"] | ||
exclude: | ||
# Admin tests need landscape on juju 2 | ||
- tox-environment: db-admin-relation-integration | ||
juju-snap-channel: "3.1/stable" | ||
include: | ||
- tox-environments: database-relation-integration | ||
agent-versions: "2.9.45" # renovate: latest juju 2 | ||
free-disk-space: true | ||
- tox-environments: database-relation-integration | ||
agent-versions: "3.1.6" # renovate: latest juju 3 | ||
free-disk-space: true | ||
- tox-environments: db-admin-relation-integration | ||
agent-versions: "2.9.45" # renovate: latest juju 2 | ||
free-disk-space: true | ||
name: ${{ matrix.tox-environments }} | ${{ matrix.agent-versions }} | ||
- juju-snap-channel: "3.1/stable" | ||
agent-version: "3.1.6" | ||
libjuju-version: "3.2.2" | ||
exclude-mark: "juju2" | ||
- juju-snap-channel: "2.9/stable" | ||
agent-version: "2.9.45" | ||
libjuju-version: "2.9.45.0" | ||
exclude-mark: "juju3" | ||
carlcsaposs-canonical marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: ${{ matrix.juju-snap-channel }} - (GH hosted) ${{ matrix.tox-environment }} | ||
needs: | ||
- lint | ||
- unit-test | ||
|
@@ -93,48 +87,49 @@ jobs: | |
timeout-minutes: 120 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Free disk space | ||
if: ${{ matrix.free-disk-space == true }} | ||
uses: actions/checkout@v4 | ||
- name: Install tox & poetry | ||
run: | | ||
sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true | ||
sudo rm -rf \ | ||
/usr/share/dotnet /usr/local/lib/android /opt/ghc \ | ||
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ | ||
/usr/lib/jvm || true | ||
- name: Set channel | ||
pipx install tox | ||
pipx install poetry | ||
- name: Free up disk space | ||
run: | | ||
juju_channel=$(echo "${{ matrix.agent-versions }}" | cut -c 1-3) | ||
echo "channel=${juju_channel}/stable" >> "$GITHUB_ENV" | ||
juju_major=$(echo "${{ matrix.agent-versions }}" | cut -c 1) | ||
echo "libjuju=juju${juju_major}" >> "$GITHUB_ENV" | ||
# From https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 | ||
sudo rm -rf /usr/share/dotnet | ||
sudo rm -rf /opt/ghc | ||
sudo rm -rf /usr/local/share/boost | ||
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | ||
- name: Setup operator environment | ||
# TODO: Replace with custom image on self-hosted runner | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: lxd | ||
bootstrap-options: "--agent-version ${{ matrix.agent-versions }}" | ||
juju-channel: "${{ env.channel }}" | ||
bootstrap-options: "--agent-version ${{ matrix.agent-version }}" | ||
juju-channel: ${{ matrix.juju-snap-channel }} | ||
- name: Update python-libjuju version | ||
if: ${{ matrix.juju-snap-channel == '2.9/stable' }} | ||
run: poetry add --lock --group integration juju@'${{ matrix.libjuju-version }}' | ||
- name: Download packed charm(s) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ needs.build.outputs.artifact-name }} | ||
- name: Select tests | ||
id: select-tests | ||
- name: Select test stability level | ||
id: select-test-stability | ||
run: | | ||
if [ "${{ github.event_name }}" == "schedule" ] | ||
if [[ "${{ github.event_name }}" == "schedule" ]] | ||
then | ||
echo Running unstable and stable tests | ||
echo "mark_expression=" >> $GITHUB_OUTPUT | ||
echo "mark_expression=" >> "$GITHUB_OUTPUT" | ||
else | ||
echo Skipping unstable tests | ||
echo "mark_expression=and not unstable" >> $GITHUB_OUTPUT | ||
echo "mark_expression=and not unstable" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Run integration tests | ||
run: tox run -e ${{ matrix.tox-environments }}-${{ env.libjuju }} -- -m 'not not${{ env.libjuju }} ${{ steps.select-tests.outputs.mark_expression }}' --keep-models | ||
run: tox run -e ${{ matrix.tox-environment }} -- -m 'not ${{ matrix.exclude-mark }} ${{ steps.select-test-stability.outputs.mark_expression }}' --keep-models | ||
env: | ||
AWS_ACCESS_KEY: "${{ secrets.AWS_ACCESS_KEY }}" | ||
AWS_SECRET_KEY: "${{ secrets.AWS_SECRET_KEY }}" | ||
GCP_ACCESS_KEY: "${{ secrets.GCP_ACCESS_KEY }}" | ||
GCP_SECRET_KEY: "${{ secrets.GCP_SECRET_KEY }}" | ||
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }} | ||
SECRETS_FROM_GITHUB: | | ||
{ | ||
"AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", | ||
"AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", | ||
"GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", | ||
"GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", | ||
} |
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still want this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not needed based on Alex comments some time ago and also because we should move to self hosted runners later (which should have more runners available as I heard recently).