-
Notifications
You must be signed in to change notification settings - Fork 2
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
ci: Add workflow files #1
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,70 @@ | ||
# Copyright 2024 Canonical Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: Bug Report | ||
description: File a bug report | ||
labels: ["Type: Bug", "Status: Triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: > | ||
Thanks for taking the time to fill out this bug report! Before submitting your issue, please make | ||
sure you are using the latest version of the charm. If not, please switch to the latest version of this charm | ||
before posting your report to make sure it's not already solved. | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: Bug Description | ||
description: > | ||
Provide a description of the issue you are facing. If applicable, add screenshots to help explain the problem. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: To Reproduce | ||
description: > | ||
Please provide a step-by-step instruction of how to reproduce the behaviour. | ||
placeholder: | | ||
1. `juju deploy ...` | ||
2. `juju integrate ...` | ||
3. `juju status --integrations` | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: environment | ||
attributes: | ||
label: Environment | ||
description: > | ||
We need to know a bit more about the context in which you run the charm. | ||
- Are you running Juju locally, on lxd, in multipass or on some other platform? | ||
- What track and channel you deployed the charm from (ie. `latest/edge` or similar). | ||
- Version of any applicable components, like the juju snap, the model controller, lxd, microk8s, and/or multipass. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Relevant log output | ||
description: > | ||
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. | ||
Fetch the logs using `juju debug-log --replay`. Additional details on how to retrieve logs are available in the juju | ||
documentation at https://juju.is/docs/juju/log. | ||
render: shell | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context |
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,110 @@ | ||
# Copyright 2024 Canonical Ltd. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: filesystem-client tests | ||
on: | ||
workflow_call: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
inclusive-naming-check: | ||
name: Inclusive naming check | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run tests | ||
uses: get-woke/woke-action@v0 | ||
with: | ||
fail-on-error: true | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Just | ||
uses: extractions/setup-just@v2 | ||
with: | ||
just-version: 1.38.0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: "0.5.8" | ||
- name: Run linters | ||
run: just lint | ||
|
||
unit-test: | ||
name: Unit tests | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Just | ||
uses: extractions/setup-just@v2 | ||
with: | ||
just-version: 1.38.0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: 0.5.8 | ||
- name: Run unit tests | ||
run: just unit | ||
|
||
type-check: | ||
name: Static type checking | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Just | ||
uses: extractions/setup-just@v2 | ||
with: | ||
just-version: 1.38.0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: 0.5.8 | ||
- name: Run tests | ||
run: just type | ||
|
||
integration-test: | ||
name: Integration tests (LXD) | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- inclusive-naming-check | ||
- lint | ||
- unit-test | ||
- type-check | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Just | ||
uses: extractions/setup-just@v2 | ||
with: | ||
just-version: 1.38.0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: 0.5.8 | ||
- name: Setup operator environment | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: lxd | ||
juju-channel: 3.4/stable | ||
- name: Run tests | ||
run: just integration |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import logging | ||
from pathlib import Path | ||
|
||
import juju | ||
import pytest | ||
import yaml | ||
from charms.filesystem_client.v0.interfaces import CephfsInfo, NfsInfo | ||
|
@@ -44,7 +45,12 @@ async def test_build_and_deploy(ops_test: OpsTest): | |
|
||
# Deploy the charm and wait for active/idle status | ||
await asyncio.gather( | ||
ops_test.model.deploy("ubuntu", application_name="ubuntu", base="[email protected]"), | ||
ops_test.model.deploy( | ||
"ubuntu", | ||
application_name="ubuntu", | ||
base="[email protected]", | ||
constraints=juju.constraints.parse("virt-type=virtual-machine"), | ||
), | ||
ops_test.model.deploy( | ||
charm, | ||
application_name=APP_NAME, | ||
|
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.
[non-block/foresight]: should it be
static
ortype
? Some of our repositories usestatic
while others usetype
. We're invoking a "static type" checker, so it's not immediately clear to me which one we should pick, but we should pick one.Personally I'm leaning towards
static
since we're checking the static types and annotations we've added to the code that are known before "compiling" the Python code at runtime.type
, at least to me, is slightly more vague since it's not immediate clear what is being checked (dynamic v.s. static types).We can bikeshed on this next week though since it's a shorter pulse.
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 took the name from the slurm-charms repo, but both
static
andtype
seem too vague IMO. I was considering changing it totypecheck
which is a bit longer but easier to remember.