Add per-module bats coverage for apl-feed CLI helpers #68
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, dev] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: shellcheck + bash -n | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install shellcheck | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y shellcheck | |
| - name: Run shellcheck (warning severity) | |
| run: | | |
| find . -name '*.sh' -not -path './.git/*' -print0 \ | |
| | xargs -0 shellcheck -S warning | |
| - name: Run bash syntax check | |
| run: | | |
| find . -name '*.sh' -not -path './.git/*' -print0 \ | |
| | xargs -0 -n1 bash -n | |
| test: | |
| name: bats | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install bats, jq, curl, python3 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y bats jq curl python3 | |
| - name: Run bats suite | |
| run: bats test/ | |
| installer-smoke: | |
| name: installer smoke (${{ matrix.image }}, ${{ matrix.path }}) | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 45 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| image: | |
| - debian:13-slim | |
| - ubuntu:24.04 | |
| path: | |
| - bundled | |
| - standalone | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Pin local branch ref to HEAD | |
| env: | |
| BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| run: | | |
| git -C "$PWD" branch -f "$BRANCH" HEAD | |
| - name: Run installer smoke | |
| env: | |
| FEED_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| IMAGE: ${{ matrix.image }} | |
| TEST_PATH: ${{ matrix.path }} | |
| run: | | |
| docker run --rm \ | |
| -e AIRPLANES_FEED_REPO=file:///workspace \ | |
| -e AIRPLANES_FEED_BRANCH="$FEED_BRANCH" \ | |
| -e AIRPLANES_TEST_PATH="$TEST_PATH" \ | |
| -v "$PWD:/workspace:ro" \ | |
| "$IMAGE" \ | |
| bash /workspace/test/installer-smoke.sh | |
| image-rootfs-smoke: | |
| name: image rootfs smoke | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout feed | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| path: feed | |
| - name: Checkout image updater | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| repository: airplanes-live/airplanes-update | |
| path: airplanes-update | |
| - name: Run image rootfs smoke | |
| run: | | |
| docker run --rm \ | |
| -e AIRPLANES_FEED_DIR=/feed \ | |
| -e AIRPLANES_UPDATE_DIR=/airplanes-update \ | |
| -v "$PWD/feed:/feed:ro" \ | |
| -v "$PWD/airplanes-update:/airplanes-update:ro" \ | |
| debian:13-slim \ | |
| bash /feed/test/image-rootfs-smoke.sh | |
| image-release-rootfs-smoke: | |
| name: image release rootfs smoke | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout feed | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Install image smoke dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| curl \ | |
| git \ | |
| jq \ | |
| parted \ | |
| p7zip-full \ | |
| rsync \ | |
| unzip \ | |
| xz-utils | |
| - name: Run mounted release image smoke | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| AIRPLANES_IMAGE_RELEASE_REPO: airplanes-live/image-releases | |
| AIRPLANES_IMAGE_CONTRACT: legacy | |
| AIRPLANES_RELEASE_ROOTFS_WORK_DIR: ${{ runner.temp }}/airplanes-image-release-rootfs-smoke | |
| run: | | |
| sudo --preserve-env=GITHUB_TOKEN,AIRPLANES_IMAGE_RELEASE_REPO,AIRPLANES_IMAGE_CONTRACT,AIRPLANES_RELEASE_ROOTFS_WORK_DIR \ | |
| bash test/image-release-rootfs-smoke.sh | |
| update-regression: | |
| name: update-regression smoke | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 25 | |
| steps: | |
| - name: Checkout feed | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| path: feed | |
| - name: Pin local "dev" branch to PR HEAD | |
| run: | | |
| # Force-label the PR head as "dev" locally so the install path the | |
| # smoke exercises matches what production code paths look for. The | |
| # image's stage-06 release-channel allowlist (and feed update.sh) | |
| # only accepts {main, dev}, so a real PR branch name like | |
| # "feature/foo" would be refused even though it carries the code we | |
| # want under test. Branch labels are local only — origin is unchanged. | |
| git -C feed branch -f dev HEAD | |
| - name: Checkout image regression harness | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| repository: airplanes-live/image | |
| ref: dev | |
| path: image | |
| - name: Run update-regression smoke against feed PR head | |
| env: | |
| AIRPLANES_FEED_BRANCH: dev | |
| run: bash image/test/update-regression-smoke.sh feed | |
| - name: Upload regression artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: update-regression-artifacts | |
| path: ${{ runner.temp }}/update-regression |