forked from canonical/postgresql-k8s-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPE-2788] update data-platform-workflows (canonical#308)
* Initial switch * Add missing integration deps * Remove schedule * No excludes * Bump libs and actions * Increase upgrade timeout
- Loading branch information
Showing
18 changed files
with
1,016 additions
and
904 deletions.
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,16 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"], | ||
"reviewers": ["dragomirp", "marceloneppel", "taurus-forever"], | ||
"packageRules": [ | ||
// Later rules override earlier rules | ||
], | ||
"regexManagers": [ | ||
{ | ||
"fileMatch": ["(^|/)([\\w-]*)charmcraft\\.ya?ml$"], | ||
"matchStrings": ["- (?<depName>.*?)(?:\\[.*?\\])?==(?<currentValue>.*?) +# renovate"], | ||
"datasourceTemplate": "pypi", | ||
"versioningTemplate": "loose" | ||
} | ||
] | ||
} |
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 |
---|---|---|
|
@@ -22,45 +22,38 @@ on: | |
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | ||
- name: Install tox | ||
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version | ||
run: python3 -m pip install tox | ||
- name: Run linters | ||
run: tox run -e lint | ||
uses: canonical/data-platform-workflows/.github/workflows/[email protected] | ||
|
||
unit-test: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
name: Unit test charm | ||
strategy: | ||
matrix: | ||
juju-version: | ||
- "juju2" | ||
- "juju3" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | ||
- name: Install tox | ||
# TODO: Consider replacing with custom image on self-hosted runner OR pinning version | ||
run: python3 -m pip install tox | ||
uses: actions/checkout@v4 | ||
- name: Install tox & poetry | ||
run: | | ||
pipx install tox | ||
pipx install poetry | ||
- name: Run tests | ||
run: tox run -e unit-${{ matrix.juju-version }} | ||
|
||
build: | ||
name: Build charms | ||
uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v2 | ||
name: Build charm | ||
uses: canonical/data-platform-workflows/.github/workflows/[email protected] | ||
permissions: | ||
actions: write # Needed to manage GitHub Actions cache | ||
|
||
integration-test: | ||
gh-hosted-integration-test: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 6 | ||
matrix: | ||
tox-environments: | ||
tox-environment: | ||
- backup-integration | ||
- charm-integration | ||
- database-relation-integration | ||
|
@@ -73,10 +66,17 @@ jobs: | |
- tls-integration | ||
- upgrade-integration | ||
- upgrade-from-stable-integration | ||
agent-versions: | ||
- "2.9.45" # renovate: latest juju 2 | ||
- "3.1.6" # renovate: latest juju 3 | ||
name: ${{ matrix.tox-environments }} | ${{ matrix.agent-versions }} | ||
juju-snap-channel: ["2.9/stable", "3.1/stable"] | ||
include: | ||
- juju-snap-channel: "3.1/stable" | ||
agent-version: "3.1.6" | ||
libjuju-version: "3.2.2" | ||
exclude-mark: "juju2" | ||
- juju-snap-channel: "2.9/stable" | ||
agent-version: "2.9.45" | ||
libjuju-version: "2.9.45.0" | ||
exclude-mark: "juju3" | ||
name: ${{ matrix.juju-snap-channel }} - (GH hosted) ${{ matrix.tox-environment }} | ||
needs: | ||
- lint | ||
- unit-test | ||
|
@@ -85,41 +85,43 @@ jobs: | |
timeout-minutes: 120 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 | ||
- name: Set channel | ||
uses: actions/checkout@v4 | ||
- name: Install tox & poetry | ||
run: | | ||
juju_channel=$(echo "${{ matrix.agent-versions }}" | cut -c 1-3) | ||
echo "channel=${juju_channel}/stable" >> "$GITHUB_ENV" | ||
juju_major=$(echo "${{ matrix.agent-versions }}" | cut -c 1) | ||
echo "libjuju=juju${juju_major}" >> "$GITHUB_ENV" | ||
pipx install tox | ||
pipx install poetry | ||
- name: Setup operator environment | ||
# TODO: Replace with custom image on self-hosted runner | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: microk8s | ||
channel: "1.28-strict/stable" | ||
bootstrap-options: "--agent-version ${{ matrix.agent-versions }}" | ||
juju-channel: "${{ env.channel }}" | ||
bootstrap-options: "--agent-version ${{ matrix.agent-version }}" | ||
juju-channel: ${{ matrix.juju-snap-channel }} | ||
- name: Update python-libjuju version | ||
if: ${{ matrix.juju-snap-channel == '2.9/stable' }} | ||
run: poetry add --lock --group integration juju@'${{ matrix.libjuju-version }}' | ||
- name: Download packed charm(s) | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ needs.build.outputs.artifact-name }} | ||
- name: Select tests | ||
id: select-tests | ||
- name: Select test stability level | ||
id: select-test-stability | ||
run: | | ||
if [ "${{ github.event_name }}" == "schedule" ] | ||
if [[ "${{ github.event_name }}" == "schedule" ]] | ||
then | ||
echo Running unstable and stable tests | ||
echo "mark_expression=" >> $GITHUB_OUTPUT | ||
echo "mark_expression=" >> "$GITHUB_OUTPUT" | ||
else | ||
echo Skipping unstable tests | ||
echo "mark_expression=and not unstable" >> $GITHUB_OUTPUT | ||
echo "mark_expression=and not unstable" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Run integration tests | ||
run: tox run -e ${{ matrix.tox-environments }}-${{ env.libjuju }} -- -m 'not not${{ env.libjuju }} ${{ steps.select-tests.outputs.mark_expression }}' --keep-models | ||
run: tox run -e ${{ matrix.tox-environment }} -- -m 'not ${{ matrix.exclude-mark }} ${{ steps.select-test-stability.outputs.mark_expression }}' --keep-models | ||
env: | ||
AWS_ACCESS_KEY: "${{ secrets.AWS_ACCESS_KEY }}" | ||
AWS_SECRET_KEY: "${{ secrets.AWS_SECRET_KEY }}" | ||
GCP_ACCESS_KEY: "${{ secrets.GCP_ACCESS_KEY }}" | ||
GCP_SECRET_KEY: "${{ secrets.GCP_SECRET_KEY }}" | ||
CI_PACKED_CHARMS: ${{ needs.build.outputs.charms }} | ||
SECRETS_FROM_GITHUB: | | ||
{ | ||
"AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", | ||
"AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", | ||
"GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", | ||
"GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", | ||
} |
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
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
Oops, something went wrong.