name: Nightly All-Features on: schedule: - cron: "15 3 * * *" # Daily 03:15 UTC workflow_dispatch: inputs: fail_on_failure: description: "Fail workflow when any nightly lane fails" required: true default: true type: boolean concurrency: group: nightly-all-features-${{ github.ref || github.run_id }} cancel-in-progress: true permissions: contents: read env: GIT_CONFIG_COUNT: "1" GIT_CONFIG_KEY_0: core.hooksPath GIT_CONFIG_VALUE_0: /dev/null CARGO_TERM_COLOR: always jobs: nightly-lanes: name: Nightly Lane (${{ matrix.name }}) runs-on: [self-hosted, aws-india] timeout-minutes: 70 strategy: fail-fast: false matrix: include: - name: default command: cargo test --locked --test agent_e2e --verbose install_libudev: false - name: whatsapp-web command: cargo check --locked --no-default-features --features whatsapp-web --verbose install_libudev: false - name: browser-native command: cargo check --locked --no-default-features --features browser-native --verbose install_libudev: false - name: nightly-all-features command: cargo test --locked --all-features --test agent_e2e --verbose install_libudev: true steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: fetch-depth: 0 - uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable with: toolchain: 1.92.0 - uses: useblacksmith/rust-cache@f53e7f127245d2a269b3d90879ccf259876842d5 # v3 with: prefix-key: nightly-all-features-${{ matrix.name }} - name: Ensure Linux deps for all-features lane if: matrix.install_libudev shell: bash run: | set -euo pipefail if command -v pkg-config >/dev/null 2>&1 && pkg-config --exists libudev; then echo "libudev development headers already available; skipping apt install." exit 0 fi echo "Installing missing libudev build dependencies..." for attempt in 1 2 3; do if sudo apt-get update -qq -o DPkg::Lock::Timeout=300 && \ sudo apt-get install -y --no-install-recommends --no-upgrade -o DPkg::Lock::Timeout=300 libudev-dev pkg-config; then echo "Dependency installation succeeded on attempt ${attempt}." exit 0 fi if [ "$attempt" -eq 3 ]; then echo "Failed to install libudev-dev/pkg-config after ${attempt} attempts." >&2 exit 1 fi echo "Dependency installation failed on attempt ${attempt}; retrying in 10s..." sleep 10 done - name: Run nightly lane command id: lane shell: bash run: | set -euo pipefail mkdir -p artifacts started_at="$(date +%s)" set +e bash -lc "${{ matrix.command }}" status=$? set -e finished_at="$(date +%s)" duration="$((finished_at - started_at))" lane_status="success" if [ "$status" -ne 0 ]; then lane_status="failure" fi cat > "artifacts/nightly-result-${{ matrix.name }}.json" <> "$GITHUB_STEP_SUMMARY" echo "lane_status=${lane_status}" >> "$GITHUB_OUTPUT" echo "lane_exit_code=${status}" >> "$GITHUB_OUTPUT" - name: Upload nightly lane artifact if: always() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: nightly-lane-${{ matrix.name }} path: artifacts/nightly-result-${{ matrix.name }}.json if-no-files-found: error retention-days: 30 nightly-summary: name: Nightly Summary & Routing needs: [nightly-lanes] if: always() runs-on: [self-hosted, aws-india] steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Download nightly artifacts uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: path: artifacts - name: Aggregate nightly report shell: bash env: FAIL_ON_FAILURE_INPUT: ${{ github.event.inputs.fail_on_failure || 'true' }} run: | set -euo pipefail fail_on_failure="true" if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then fail_on_failure="${FAIL_ON_FAILURE_INPUT}" fi args=() if [ "$fail_on_failure" = "true" ]; then args+=(--fail-on-failure) fi python3 scripts/ci/nightly_matrix_report.py \ --input-dir artifacts \ --owners-file .github/release/nightly-owner-routing.json \ --output-json artifacts/nightly-summary.json \ --output-md artifacts/nightly-summary.md \ "${args[@]}" - name: Publish nightly summary shell: bash run: | set -euo pipefail cat artifacts/nightly-summary.md >> "$GITHUB_STEP_SUMMARY" - name: Upload nightly summary artifacts if: always() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: nightly-all-features-summary path: | artifacts/nightly-summary.json artifacts/nightly-summary.md if-no-files-found: error retention-days: 30