1- name : Build and test charms
1+ name : Build and test charm
22
33on :
44 push :
1212 DEBIAN_FRONTEND : noninteractive
1313
1414jobs :
15- define-charm-list :
16- name : Define charm list to build
17- runs-on : ubuntu-24.04
18- outputs :
19- charms : ${{ steps.charms.outputs.charms }}
20- steps :
21- - name : Checkout
22- uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
23- with :
24- persist-credentials : false
25-
26- - name : Generate list
27- id : charms
28- run : |
29- list="$(find . -mindepth 1 -maxdepth 1 -type d -printf '"%P", ')"
30- echo "charms=[$list]"
31- echo "charms=[$list]" >> $GITHUB_OUTPUT
32- working-directory : charms
33-
3415 lint :
35- name : Lint - (${{ matrix.charm }})
16+ name : Lint
3617 runs-on : ubuntu-24.04
37- needs :
38- - define-charm-list
3918 strategy :
4019 fail-fast : false
41- matrix :
42- charm : ${{ fromJSON(needs.define-charm-list.outputs.charms) }}
4320 steps :
4421 - name : Checkout
4522 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
@@ -49,16 +26,11 @@ jobs:
4926 run : sudo snap install ruff --classic
5027 - name : Run linters
5128 run : ruff check --preview .
52- working-directory : charms/${{ matrix. charm }}
29+ working-directory : charm
5330
5431 lib-check :
55- name : Check libraries - (${{ matrix.charm }})
32+ name : Check libraries
5633 runs-on : ubuntu-24.04
57- needs :
58- - define-charm-list
59- strategy :
60- matrix :
61- charm : ${{ fromJSON(needs.define-charm-list.outputs.charms) }}
6234 permissions :
6335 contents : write
6436 pull-requests : write
@@ -72,16 +44,11 @@ jobs:
7244 uses : canonical/charming-actions/check-libraries@1753e0803f70445132e92acd45c905aba6473225 # 2.7.0
7345 with :
7446 github-token : " ${{ secrets.GITHUB_TOKEN }}"
75- charm-path : charms/${{ matrix.charm }}
47+ charm-path : .
7648
7749 pack-charm :
78- name : Build charm - (${{ matrix.charm }})
50+ name : Build charm
7951 runs-on : ubuntu-24.04
80- needs :
81- - define-charm-list
82- strategy :
83- matrix :
84- charm : ${{ fromJSON(needs.define-charm-list.outputs.charms) }}
8552 steps :
8653 - name : Checkout
8754 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
@@ -102,24 +69,22 @@ jobs:
10269
10370 - name : Pack charm
10471 run : charmcraft pack -v
105- working-directory : charms/${{ matrix.charm }}
10672
10773 - name : Test charm
108- run : uv run --all-extras pytest tests/ -vv --log-level=INFO
109- working-directory : charms/${{ matrix. charm }}
74+ run : uv run --all-extras pytest -vv --log-level=INFO .
75+ working-directory : charm/tests
11076
11177 - name : Upload charm artifact
11278 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
11379 with :
114- name : ${{ matrix.charm }} .charm
115- path : charms/${{ matrix.charm }}/ *.charm
80+ name : error-tracker .charm
81+ path : " *.charm"
11682
11783 - name : Upload charm to charmhub
11884 uses : canonical/charming-actions/upload-charm@1753e0803f70445132e92acd45c905aba6473225 # 2.7.0
11985 with :
12086 credentials : ' ${{ secrets.CHARMHUB_TOKEN }}'
12187 github-token : ' ${{ secrets.GITHUB_TOKEN }}'
122- charm-path : charms/${{ matrix.charm }}
12388 tag-prefix : ${{ matrix.charm }}
124- built-charm-path : error-tracker-${{ matrix.charm }}_ubuntu @24.04-amd64.charm
89+ built-charm-path : error-tracker_ubuntu @24.04-amd64.charm
12590 if : github.ref == 'refs/heads/main'
0 commit comments