Skip to content

Commit

Permalink
update .github/workflows/check.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
soleng-terraform[bot] authored Aug 28, 2024
1 parent c18eda6 commit d745780
Showing 1 changed file with 46 additions and 6 deletions.
52 changes: 46 additions & 6 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ jobs:
matrix:
runs-on: [[ubuntu-latest]]
test-command: ['FUNC_ARGS="--series focal" make functional', 'FUNC_ARGS="--series jammy" make functional']
juju-channel: ["3.4/stable"]
steps:

- uses: actions/checkout@v4
with:
submodules: true

# arm64 runners don't have make or gcc installed by default
- name: Install dependencies
 run: |
 sudo apt update
 sudo apt install -y make gcc

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand All @@ -54,14 +61,9 @@ jobs:
uses: charmed-kubernetes/actions-operator@main
with:
provider: "lxd"
juju-channel: "3.4/stable"
juju-channel: ${{ matrix.juju-channel }}
charmcraft-channel: "2.x/stable"

- name: Show juju information
run: |
juju version
juju controllers | grep Version -A 1 | awk '{print $9}'
# This is used by zaza in the functional tests for non-amd64 architectures (if applicable)
- name: Set zaza juju model constraints for architecture
run: |
Expand All @@ -73,3 +75,41 @@ jobs:
run: ${{ matrix.test-command }}
env:
TEST_JUJU3: "1" # https://github.com/openstack-charmers/zaza/pull/653
TEST_JUJU_CHANNEL: ${{ matrix.juju-channel }}

# Save output for debugging

- name: Generate debugging information
if: always()
run: |
set -x
# install dependencies
sudo snap install --classic juju-crashdump
sudo apt install -y jq uuid
# Print juju controller information for debugging
# to check controller and client are compatible versions;
# we can have a mismatch if using an external controller.
juju version
juju controllers
models="$(juju models --format json | jq -r '.models[]."short-name"')"
dir="$(mktemp -d)"
# Use a different dir to avoid charmed-kubernetes/actions-operator from also trying to upload crashdumps.
# We don't want to rely on that action, because it doesn't use a descriptive enough name for the artefact,
# and we may stop using that action soon.
echo "CRASHDUMPS_DIR=$dir" | tee -a "$GITHUB_ENV"
echo "CRASHDUMPS_ARTEFACT_SUFFIX=$(uuid)-$(uname -m)" | tee -a "$GITHUB_ENV"
for model in $models; do
# show status here for quick debugging
juju status -m "$model"
juju-crashdump --as-root -m "$model" -u "$model-$(uname -m)" -o "$dir"
done
- name: Upload juju crashdumps
uses: actions/upload-artifact@v4
if: always()
with:
name: "juju-crashdumps-${{ env.CRASHDUMPS_ARTEFACT_SUFFIX }}"
path: "${{ env.CRASHDUMPS_DIR }}/juju-crashdump-*.tar.xz"

0 comments on commit d745780

Please sign in to comment.