Skip to content
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

Split bases #252

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Render k8s Charm
run: tox -e render-k8s
- name: Pack Artifact
run: sudo apt-get update && sudo apt-get install tar && tar czvf artifact.tar.gz metadata.yaml src/charm.py
run: sudo apt-get update && sudo apt-get install tar && tar czvf artifact.tar.gz charmcraft.yaml metadata.yaml src/charm.py
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
venv/
build/
*.charm
*.orig
.coverage
__pycache__/
*.py[cod]
.tox
.idea/
tests/integration/*-tester/lib/
charmcraft.yaml
metadata.yaml
src/charm.py
.env
3 changes: 0 additions & 3 deletions charmcraft.yaml → k8s_charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ bases:
- name: "ubuntu"
channel: "22.04"
architectures: ["amd64"]
- name: "ubuntu"
channel: "20.04"
architectures: ["amd64"]
parts:
charm:
build-packages:
Expand Down
34 changes: 34 additions & 0 deletions machine_charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.

type: charm
bases:
- build-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["amd64"]
run-on:
- name: "ubuntu"
channel: "20.04"
architectures: ["amd64"]
- build-on:
- name: "ubuntu"
channel: "22.04"
architectures: ["amd64"]
run-on:
- name: "ubuntu"
channel: "22.04"
architectures: ["amd64"]
parts:
charm:
build-packages:
- git

# The following are needed for tls-certificates-interface
- build-essential
- python3-dev
- libffi-dev
- libssl-dev
- pkg-config
- rustc
- cargo
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ allowlist_externals = cp
commands =
cp {toxinidir}/src/k8s_charm.py {toxinidir}/src/charm.py
cp {toxinidir}/k8s_metadata.yaml {toxinidir}/metadata.yaml
cp {toxinidir}/k8s_charmcraft.yaml {toxinidir}/charmcraft.yaml

[testenv:render-machine]
skip_install=True
Expand All @@ -55,6 +56,7 @@ commands =
cp {toxinidir}/src/machine_charm.py {toxinidir}/src/charm.py
chmod +x {toxinidir}/src/charm.py
cp {toxinidir}/machine_metadata.yaml {toxinidir}/metadata.yaml
cp {toxinidir}/machine_charmcraft.yaml {toxinidir}/charmcraft.yaml

[testenv:lint]
skip_install=True
Expand Down Expand Up @@ -141,6 +143,7 @@ commands =
# use a better solution when we actually have machine code
cp {[vars]src_path}/k8s_charm.py {[vars]src_path}/charm.py
cp k8s_metadata.yaml metadata.yaml
cp k8s_charmcraft.yaml charmcraft.yaml

pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tst_path}/integration

Expand All @@ -162,6 +165,7 @@ allowlist_externals = cp
commands =
cp {[vars]src_path}/machine_charm.py {[vars]src_path}/charm.py
cp machine_metadata.yaml metadata.yaml
cp machine_charmcraft.yaml charmcraft.yaml
pytest -vv --tb native --log-cli-level=INFO -s {posargs} {[vars]tst_path}/scenario/test_machine_charm --ignore {[vars]tst_path}/scenario/test_k8s

[testenv:scenario-k8s]
Expand Down
Loading