Smoke Test #3
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: Smoke Test | |
| # Full install + run-tests.sh regression suite. | |
| # | |
| # REQUIREMENTS: | |
| # This workflow installs real tools from the prebuilt archives. | |
| # The prebuilt submodule must contain the tool archives (tar.xz / zip), | |
| # OR a self-hosted runner must have them pre-staged at the repo root. | |
| # GitHub-hosted runners can run this only if archives are committed to | |
| # the prebuilt submodule (large files should use Git LFS). | |
| # | |
| # TRIGGERS: | |
| # - Weekly (Monday 06:00 UTC) -- automated regression check | |
| # - workflow_dispatch -- manual trigger with profile selection | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' | |
| workflow_dispatch: | |
| inputs: | |
| profile: | |
| description: 'Install profile' | |
| required: false | |
| default: 'minimal' | |
| type: choice | |
| options: [minimal, cpp-dev, devops, full] | |
| os: | |
| description: 'Platform to test' | |
| required: false | |
| default: 'both' | |
| type: choice | |
| options: [both, linux-only, windows-only] | |
| concurrency: | |
| group: smoke-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| smoke-test: | |
| name: Smoke test -- ${{ matrix.label }} | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| label: Linux (ubuntu-latest) | |
| os_flag: linux | |
| skip_if: ${{ github.event.inputs.os == 'windows-only' }} | |
| - runner: windows-latest | |
| label: Windows (windows-latest) | |
| os_flag: windows | |
| skip_if: ${{ github.event.inputs.os == 'linux-only' }} | |
| steps: | |
| - name: Skip check | |
| if: matrix.skip_if == 'true' | |
| run: echo "Skipping ${{ matrix.label }} as requested." && exit 0 | |
| - name: Checkout (with all submodules) | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| submodules: recursive | |
| # -- Install ───────────────────────────────────────────────────────── | |
| - name: Install tools | |
| shell: bash | |
| run: | | |
| PROFILE="${{ github.event.inputs.profile || 'minimal' }}" | |
| case "$PROFILE" in | |
| minimal|cpp-dev|devops|full) ;; | |
| *) echo "Invalid profile: $PROFILE"; exit 1 ;; | |
| esac | |
| echo "Installing profile: $PROFILE" | |
| bash scripts/install-cli.sh --yes --profile "$PROFILE" | |
| # -- Smoke tests ────────────────────────────────────────────────────── | |
| - name: Run smoke tests | |
| shell: bash | |
| run: bash tests/run-tests.sh --verbose | |
| # -- check_cmd regression ───────────────────────────────────────────── | |
| - name: Run check_cmd for installed tools | |
| shell: bash | |
| run: bash tests/check-installed-tools.sh --verbose | |
| # -- Artifacts ──────────────────────────────────────────────────────── | |
| - name: Collect receipts | |
| if: always() | |
| shell: bash | |
| run: | | |
| mkdir -p /tmp/receipts | |
| # Search known install prefixes only; 'find /' exits 1 on permission | |
| # errors and breaks the step under GitHub Actions' -eo pipefail. | |
| SEARCH=( | |
| "${HOME}/.local/share/airgap-cpp-devkit" | |
| "/opt/airgap-cpp-devkit" | |
| ) | |
| if [[ -n "${LOCALAPPDATA:-}" ]]; then | |
| WIN="$(cygpath -u "${LOCALAPPDATA}" 2>/dev/null || true)/airgap-cpp-devkit" | |
| [[ -d "${WIN}" ]] && SEARCH+=("${WIN}") | |
| fi | |
| find "${SEARCH[@]}" -name "INSTALL_RECEIPT.txt" -not -path "*/.git/*" \ | |
| 2>/dev/null | while read -r f; do | |
| dest="/tmp/receipts/$(echo "$f" | tr '/' '_').txt" | |
| cp "$f" "$dest" 2>/dev/null || true | |
| done || true | |
| - name: Upload receipts | |
| if: always() | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: install-receipts-${{ matrix.os_flag }} | |
| path: /tmp/receipts/ | |
| if-no-files-found: ignore | |
| retention-days: 14 |