16
16
jobs :
17
17
lint :
18
18
name : Lint
19
- uses : canonical/data-platform-workflows/.github/workflows/lint.yaml@v9.0.2
19
+ uses : canonical/data-platform-workflows/.github/workflows/lint.yaml@v9.3.1
20
20
21
21
unit-test :
22
- strategy :
23
- fail-fast : false
24
- matrix :
25
- juju-version : ["2.9", "3.1"]
26
22
name : Unit test charm
27
23
runs-on : ubuntu-latest
28
24
timeout-minutes : 5
@@ -35,124 +31,40 @@ jobs:
35
31
pipx install poetry
36
32
- name : Run tests
37
33
run : tox run -e unit
38
- env :
39
- # This env var is only to indicate Juju version to "simulate" in the unit tests
40
- # No libjuju is being actually used in unit testing
41
- LIBJUJU_VERSION_SPECIFIER : ${{ matrix.juju-version }}
42
34
- name : Upload Coverage to Codecov
43
35
uses : codecov/codecov-action@v3
44
36
45
37
build :
46
38
name : Build charm
47
- uses : canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v9.0.2
39
+ uses : canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v9.3.1
48
40
with :
49
41
charmcraft-snap-channel : beta
50
42
51
- gh-hosted-collect-integration-tests :
52
- name : (GH hosted) Collect integration test groups
53
- needs :
54
- - lint
55
- - unit-test
56
- runs-on : ubuntu-latest
57
- steps :
58
- - name : Checkout
59
- uses : actions/checkout@v3
60
- - name : Install tox & poetry
61
- run : |
62
- pipx install tox
63
- pipx install poetry
64
- - name : Select test stability level
65
- id : select-test-stability
66
- run : |
67
- if [[ "${{ github.event_name }}" == "schedule" ]]
68
- then
69
- echo Running unstable and stable tests
70
- echo "mark_expression=" >> "$GITHUB_OUTPUT"
71
- else
72
- echo Skipping unstable tests
73
- echo "mark_expression=not unstable" >> "$GITHUB_OUTPUT"
74
- fi
75
- - name : Collect test groups
76
- id : collect-groups
77
- run : tox run -e integration -- tests/integration -m '${{ steps.select-test-stability.outputs.mark_expression }}' --collect-groups
78
- outputs :
79
- groups : ${{ steps.collect-groups.outputs.groups }}
80
-
81
- gh-hosted-integration-test :
43
+ integration-test :
82
44
strategy :
83
45
fail-fast : false
84
46
matrix :
85
- groups : ${{ fromJSON(needs.gh-hosted-collect-integration-tests.outputs.groups) }}
86
- juju-snap-channel : ["2.9/stable", "3.1/stable"]
87
- include :
88
- - juju-snap-channel : " 3.1/stable"
89
- agent-version : " 3.1.6"
90
- libjuju-version : " 3.2.2"
91
- - juju-snap-channel : " 2.9/stable"
92
- agent-version : " 2.9.45"
93
- libjuju-version : " 2.9.44.1"
94
- exclude :
95
- # Disabling HA tests, as long as we want to have a limited pipeline on Juju3
96
- - juju-snap-channel : " 3.1/stable"
97
- groups :
98
- job_name : " high_availability/test_replication.py | group 1"
99
- - juju-snap-channel : " 3.1/stable"
100
- groups :
101
- job_name : " high_availability/test_self_healing.py | group 1"
102
- - juju-snap-channel : " 3.1/stable"
103
- groups :
104
- job_name : " high_availability/test_upgrade.py | group 1"
105
- - juju-snap-channel : " 3.1/stable"
106
- groups :
107
- job_name : " high_availability/test_upgrade_from_stable.py | group 1"
108
- name : ${{ matrix.juju-snap-channel }} - (GH hosted) ${{ matrix.groups.job_name }}
47
+ juju :
48
+ - agent : 2.9.45
49
+ libjuju : ^2
50
+ - agent : 3.1.6
51
+ name : Integration test charm | ${{ matrix.juju.agent }}
109
52
needs :
110
53
- lint
111
54
- unit-test
112
55
- build
113
- - gh-hosted-collect-integration-tests
114
- runs-on : ubuntu-latest
115
- timeout-minutes : 120
116
- steps :
117
- - name : Checkout
118
- uses : actions/checkout@v3
119
- - name : Install tox & poetry
120
- run : |
121
- pipx install tox
122
- pipx install poetry
123
- - name : Setup operator environment
124
- uses : charmed-kubernetes/actions-operator@main
125
- with :
126
- provider : microk8s
127
- channel : " 1.28-strict/stable"
128
- bootstrap-options : " --agent-version ${{ matrix.agent-version }}"
129
- juju-channel : ${{ matrix.juju-snap-channel }}
130
- - name : Update python-libjuju version
131
- if : ${{ matrix.libjuju-version == '2.9.44.1' }}
132
- run : poetry add --lock --group integration juju@'${{ matrix.libjuju-version }}'
133
- - name : Download packed charm(s)
134
- uses : actions/download-artifact@v3
135
- with :
136
- name : ${{ needs.build.outputs.artifact-name }}
137
- - name : Select test stability level
138
- id : select-test-stability
139
- run : |
140
- if [[ "${{ github.event_name }}" == "schedule" ]]
141
- then
142
- echo Running unstable and stable tests
143
- echo "mark_expression=" >> "$GITHUB_OUTPUT"
144
- else
145
- echo Skipping unstable tests
146
- echo "mark_expression=not unstable" >> "$GITHUB_OUTPUT"
147
- fi
148
- - name : Run integration tests
149
- run : tox run -e integration -- "${{ matrix.groups.path_to_test_file }}" --group="${{ matrix.groups.group_number }}" -m '${{ steps.select-test-stability.outputs.mark_expression }}'
150
- env :
151
- LIBJUJU_VERSION_SPECIFIER : ${{ matrix.libjuju-version }}
152
- SECRETS_FROM_GITHUB : |
153
- {
154
- "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}",
155
- "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}",
156
- "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}",
157
- "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}",
158
- }
56
+ uses :
canonical/data-platform-workflows/.github/workflows/[email protected]
57
+ with :
58
+ artifact-name : ${{ needs.build.outputs.artifact-name }}
59
+ cloud : microk8s
60
+ microk8s-snap-channel : 1.28-strict/stable
61
+ juju-agent-version : ${{ matrix.juju.agent }}
62
+ libjuju-version-constraint : ${{ matrix.juju.libjuju }}
63
+ secrets :
64
+ integration-test : |
65
+ {
66
+ "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}",
67
+ "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}",
68
+ "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}",
69
+ "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}",
70
+ }
0 commit comments