Skip to content

Commit ccdec9b

Browse files
[DPE-2904] Switch to self hosted runners (#285)
* DO NOT MERGE test self-hsoted runners * Remove groups * Add group markers * fix pythonpath * Switch to relative imports * Switch to binary psycopg2 for test deps * Conditionally skip tests * Bump timeouts * Skipping fixtures and bump in timeouts * Juju matrix * Revert "Juju matrix" This reverts commit 24c9f8c. * Juju2 job * Revert backup changes * Bump timeouts * Switch to dpw 6 * More timeout bumps * Increase timeouts * Bump dpw * Depend on unit tests * Increase timeouts * Skip additional backup test when secrets are not accessible * Even more timouts * Retry getting password if no primary was found * Timeouts * Bump dpw * Try to preenable plpython * Add markers and cleanup tox ini * Marks * Switch to mainline workflow * Bump actions * Matrix integration * Update contributing * Use the right workflow * Bump action --------- Co-authored-by: Carl Csaposs <[email protected]>
1 parent 6ed8a92 commit ccdec9b

28 files changed

+288
-449
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
jobs:
2323
lint:
2424
name: Lint
25-
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v5.1.2
25+
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v6.3.2
2626

2727
unit-test:
2828
name: Unit test charm
@@ -42,100 +42,35 @@ jobs:
4242

4343
build:
4444
name: Build charm
45-
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v5.1.2
45+
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v6.3.2
4646
permissions:
4747
actions: write # Needed to manage GitHub Actions cache
4848

49-
gh-hosted-integration-test:
49+
50+
integration-test:
5051
strategy:
5152
fail-fast: false
5253
matrix:
53-
tox-environment:
54-
- backup-integration
55-
- charm-integration
56-
- database-relation-integration
57-
- db-relation-integration
58-
- db-admin-relation-integration
59-
- ha-replication-integration
60-
- ha-self-healing-integration
61-
- ha-restore-cluster-integration
62-
- password-rotation-integration
63-
- plugins-integration
64-
- tls-integration
65-
- upgrade-integration
66-
- upgrade-from-stable-integration
67-
juju-snap-channel: ["2.9/stable", "3.1/stable"]
68-
exclude:
69-
# Admin tests need landscape on juju 2
70-
- tox-environment: db-admin-relation-integration
71-
juju-snap-channel: "3.1/stable"
72-
include:
73-
- juju-snap-channel: "3.1/stable"
74-
agent-version: "3.1.6"
75-
libjuju-version: "3.2.2"
76-
exclude-mark: "juju2"
77-
- juju-snap-channel: "2.9/stable"
78-
agent-version: "2.9.45"
79-
libjuju-version: "2.9.45.0"
80-
exclude-mark: "juju3"
81-
name: ${{ matrix.juju-snap-channel }} - (GH hosted) ${{ matrix.tox-environment }}
54+
juju:
55+
- agent: 2.9.45
56+
libjuju: ^2
57+
- agent: 3.1.6
58+
name: Integration test charm | ${{ matrix.juju.agent }}
8259
needs:
8360
- lint
8461
- unit-test
8562
- build
86-
runs-on: ubuntu-latest
87-
timeout-minutes: 120
88-
steps:
89-
- name: Checkout
90-
uses: actions/checkout@v4
91-
- name: Install tox & poetry
92-
run: |
93-
pipx install tox
94-
pipx install poetry
95-
- name: Free up disk space
96-
run: |
97-
# From https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
98-
sudo rm -rf /usr/share/dotnet
99-
sudo rm -rf /opt/ghc
100-
sudo rm -rf /usr/local/share/boost
101-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
102-
- name: Setup operator environment
103-
uses: charmed-kubernetes/actions-operator@main
104-
with:
105-
provider: lxd
106-
bootstrap-options: "--agent-version ${{ matrix.agent-version }}"
107-
juju-channel: ${{ matrix.juju-snap-channel }}
108-
- name: Update python-libjuju version
109-
if: ${{ matrix.juju-snap-channel == '2.9/stable' }}
110-
run: poetry add --lock --group integration juju@'${{ matrix.libjuju-version }}'
111-
- name: Download packed charm(s)
112-
uses: actions/download-artifact@v3
113-
with:
114-
name: ${{ needs.build.outputs.artifact-name }}
115-
- name: Select test stability level
116-
id: select-test-stability
117-
run: |
118-
if [[ "${{ github.event_name }}" == "schedule" ]]
119-
then
120-
echo Running unstable and stable tests
121-
echo "mark_expression=" >> "$GITHUB_OUTPUT"
122-
else
123-
echo Skipping unstable tests
124-
echo "mark_expression=and not unstable" >> "$GITHUB_OUTPUT"
125-
fi
126-
- name: Select test secret usage
127-
id: select-test-secrets
128-
if: ${{ github.event.pull_request.head.repo.full_name != 'canonical/postgresql-operator' }}
129-
run: |
130-
echo Skipping tests using secrets
131-
echo "mark_secrets=and not uses_secrets" >> "$GITHUB_OUTPUT"
132-
- name: Run integration tests
133-
run: tox run -e ${{ matrix.tox-environment }} -- -m 'not ${{ matrix.exclude-mark }} ${{ steps.select-test-secrets.outputs.mark_secrets }} ${{ steps.select-test-stability.outputs.mark_expression }}' --keep-models
134-
env:
135-
SECRETS_FROM_GITHUB: |
136-
{
137-
"AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}",
138-
"AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}",
139-
"GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}",
140-
"GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}",
141-
}
63+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
64+
with:
65+
artifact-name: ${{ needs.build.outputs.artifact-name }}
66+
cloud: lxd
67+
juju-agent-version: ${{ matrix.juju.agent }}
68+
libjuju-version-constraint: ${{ matrix.juju.libjuju }}
69+
secrets:
70+
integration-test: |
71+
{
72+
"AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}",
73+
"AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}",
74+
"GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}",
75+
"GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}",
76+
}

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424

2525
build:
2626
name: Build charm
27-
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v5.1.2
27+
uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v6.3.2
2828

2929
release:
3030
name: Release charm
3131
needs:
3232
- ci-tests
3333
- build
34-
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v5.1.2
34+
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v6.3.2
3535
with:
3636
channel: 14/edge
3737
artifact-name: ${{ needs.build.outputs.artifact-name }}

.github/workflows/sync_issue_to_jira.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
sync:
1111
name: Sync GitHub issue to Jira
12-
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v5.1.2
12+
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v6.3.2
1313
with:
1414
jira-base-url: https://warthogs.atlassian.net
1515
jira-project-key: DPE

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ tox # runs 'lint' and 'unit' environments
4343
Build the charm in this git repository using:
4444

4545
```shell
46-
charmcraft pack
46+
tox -e build
4747
```
4848

49+
The tox build environment assumes that there is a preinstalled [poetry](https://python-poetry.org/) on the system.
50+
4951
### Deploy
5052

5153
```bash

0 commit comments

Comments
 (0)