-
Notifications
You must be signed in to change notification settings - Fork 5
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
[MISC] Reusable workflow #168
Changes from 15 commits
85d7be7
ef36d7e
3141415
b4119be
b87da98
f790301
9c22ab8
a633fa2
134f04e
2969180
70ce46c
d96826c
7686b92
cdf3d9b
4766e2e
fff590f
428e087
cc973eb
9a187d3
fa485c1
97b2d31
7a02c75
dddcecd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$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 | ||
{ | ||
"matchPackageNames": ["pydantic"], | ||
"allowedVersions": "<2.0.0" | ||
}, { | ||
"matchPackageNames": ["python"], | ||
"allowedVersions": "<3.11" | ||
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider disabling python updates instead—maybe we should add this to shared config There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The python version is charm specific, it will vary depending on the base. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My suggestion is to disable automatic python updates for all charms |
||
} | ||
], | ||
"regexManagers": [ | ||
{ | ||
"fileMatch": ["(^|/)([\\w-]*)charmcraft\\.ya?ml$"], | ||
"matchStrings": ["- (?<depName>.*?)(?:\\[.*?\\])?==(?<currentValue>.*?) +# renovate"], | ||
"datasourceTemplate": "pypi", | ||
"versioningTemplate": "loose" | ||
} | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fyi charm-strict-dependencies will change how binary packages are managed would recommend enabling strict dependencies if they don't cause issues |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ on: | |
- '.jujuignore' | ||
- 'LICENSE' | ||
- '**.md' | ||
- 'renovate.json' | ||
- .github/renovate.json5 | ||
schedule: | ||
- cron: '53 0 * * *' # Daily at 00:53 UTC | ||
# Triggered on push to branch "main" by .github/workflows/release.yaml | ||
|
@@ -22,90 +22,45 @@ on: | |
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- 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/lint.yaml@v8.0.0 | ||
|
||
unit-test: | ||
name: Unit tests | ||
name: Unit test charm | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install tox | ||
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version | ||
run: python3 -m pip install tox | ||
- name: Install tox & poetry | ||
run: | | ||
pipx install tox | ||
pipx install poetry | ||
- name: Run tests | ||
run: tox run -e unit | ||
|
||
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/build_charms_with_cache.yaml@v8.0.0 | ||
permissions: | ||
actions: write # Needed to manage GitHub Actions cache | ||
|
||
integration-test: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 6 | ||
matrix: | ||
tox-environments: | ||
- backend-integration | ||
- client-relation-integration | ||
- scaling-integration | ||
- tls-integration | ||
- standalone-integration | ||
- legacy-client-relation-integration | ||
- upgrade-integration | ||
agent-versions: | ||
- "2.9.45" # renovate: latest juju 2 | ||
- "3.1.6" # renovate: latest juju 3 | ||
name: ${{ matrix.tox-environments }} | ${{ matrix.agent-versions }} | ||
juju: | ||
- agent: 2.9.46 | ||
libjuju: ^2 | ||
- agent: 3.1.6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Backend relation fails on 3.1.7. Will investigate separately. |
||
name: Integration test charm | ${{ matrix.juju.agent }} | ||
needs: | ||
- lint | ||
- unit-test | ||
- build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 120 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set channel | ||
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" | ||
- name: Setup operator environment | ||
# TODO: Replace with custom image on self-hosted runner | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: microk8s | ||
channel: "1.28-strict/stable" | ||
bootstrap-options: "--agent-version ${{ matrix.agent-versions }}" | ||
juju-channel: "${{ env.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: tox run -e ${{ matrix.tox-environments }}-${{ env.libjuju }} -- -m '${{ steps.select-tests.outputs.mark_expression }}' | ||
env: | ||
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }} | ||
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v8.0.0 | ||
with: | ||
artifact-name: ${{ needs.build.outputs.artifact-name }} | ||
cloud: microk8s | ||
microk8s-snap-channel: 1.29-strict/stable | ||
juju-agent-version: ${{ matrix.juju.agent }} | ||
libjuju-version-constraint: ${{ matrix.juju.libjuju }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ build/ | |
.coverage | ||
__pycache__/ | ||
*.py[cod] | ||
*.log | ||
*.log | ||
/requirements.txt | ||
/requirements-last-build.txt |
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.
permanent ignores for temporary issues make me worried that we'll forget about them
maybe a better option would be to manually close the PR that renovate opens so that it adds it to the ignore list?
at the least, I'd suggest adding a comment to explain why this ignore was added
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 don't consider this a temporary issue. There are multiple charm libs that will need to be updated to work with pydantic 2 and it also fails to compile with focal's rustc. I doubt we can make the jump anytime soon.