ci: arm64 support #412
Workflow file for this run
This file contains hidden or 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
| name: Check workflow running linter, unit and functional tests | ||
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| branches: [master, main] | ||
| paths-ignore: | ||
| - "**.md" | ||
| - "**.rst" | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| # lint-unit: | ||
| # uses: canonical/bootstack-actions/.github/workflows/lint-unit.yaml@v2 | ||
| # strategy: | ||
| # fail-fast: false | ||
| # matrix: | ||
| # python-version: ["3.8", "3.10"] | ||
| # with: | ||
| # python-version: ${{ matrix.python-version }} | ||
| # tox-version: "<4" | ||
| # | ||
| # promtool: | ||
| # runs-on: ubuntu-latest | ||
| # steps: | ||
| # - name: Checkout repo | ||
| # uses: actions/checkout@v3 | ||
| # # prometheus snap comes pre-packaged with promtool | ||
| # - name: Install prometheus snap | ||
| # run: sudo snap install prometheus | ||
| # - name: Check validity of prometheus alert rules | ||
| # run: | | ||
| # promtool check rules src/prometheus_alert_rules/*.yaml | ||
| # - name: Run unit tests for prometheus alert rules | ||
| # run: | | ||
| # promtool test rules tests/unit/test_alert_rules/*.yaml | ||
| # func: | ||
| # uses: canonical/bootstack-actions/.github/workflows/func.yaml@v2 | ||
| # needs: [lint-unit, promtool] | ||
| # strategy: | ||
| # fail-fast: false | ||
| # matrix: | ||
| # include: | ||
| # - juju-channel: "3.4/stable" | ||
| # command: "FUNC_ARGS='--series jammy' make functional" | ||
| # with: | ||
| # command: ${{ matrix.command }} | ||
| # juju-channel: ${{ matrix.juju-channel }} | ||
| # nested-containers: false | ||
| # provider: "lxd" | ||
| # python-version: "3.10" | ||
| # timeout-minutes: 120 | ||
| func: | ||
| name: functional tests | ||
| runs-on: $${{ matrix.runs-on }} | ||
| timeout-minutes: 120 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| runs-on: "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]" | ||
|
Check failure on line 66 in .github/workflows/check.yaml
|
||
| test-command: ["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: | ||
| python-version: "3.10" | ||
| - name: Setup Juju environment | ||
| uses: charmed-kubernetes/actions-operator@main | ||
| with: | ||
| provider: "lxd" | ||
| juju-channel: $${{ matrix.juju-channel }} | ||
| charmcraft-channel: "2.x/stable" | ||
| # This is used by zaza in the functional tests for non-amd64 architectures (if applicable) | ||
| - name: Set zaza juju model constraints for architecture | ||
| run: | | ||
| if [ "$(uname -m)" = "aarch64" ]; then | ||
| echo "TEST_MODEL_CONSTRAINTS=arch=arm64" >> "$GITHUB_ENV" | ||
| fi | ||
| - name: Run tests | ||
| 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" | ||