Skip to content

Add artifact smoke-test jobs to daily and stable build workflows#2

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-artifact-smoke-tests
Draft

Add artifact smoke-test jobs to daily and stable build workflows#2
Copilot wants to merge 3 commits into
mainfrom
copilot/add-artifact-smoke-tests

Conversation

Copy link
Copy Markdown

Copilot AI commented May 28, 2026

This adds post-build smoke tests to the existing GitHub Actions workflows so built artifacts are validated directly from workflow artifacts, without depending on S3. Daily builds now test both nightly and t8, and stable builds test the manual release output.

  • Artifact handoff

    • Added actions/upload-artifact@v4 to:
      • build-nightly
      • build-t8
      • build-stable
    • Each build publishes its output/ directory under a job-specific artifact name:
      • nightly-output
      • t8-output
      • stable-output
  • Daily workflow smoke tests

    • Added:
      • test-nightly (needs: build-nightly)
      • test-t8 (needs: build-t8)
    • Each job downloads the corresponding artifact and validates:
      • native oaf-linux-x86_64
      • Alpine oaf-alpine-x86_64 inside alpine:latest
  • Stable workflow smoke tests

    • Added test-stable (needs: build-stable)
    • Mirrors the same artifact download and smoke-test coverage as the daily workflow
  • Smoke-test coverage

    • Verifies the Linux x86_64 artifact can:
      • execute -v
      • run basic JS via -c 'print("ok")'
      • perform --install and expose ojob
    • Verifies the Alpine x86_64 artifact can execute in Docker after extraction/install
  • Workflow behavior

    • Keeps the existing S3 upload step in place
    • Restricts the new test jobs with explicit empty token permissions
test-nightly:
  runs-on: ubuntu-latest
  needs: build-nightly
  permissions: {}

  steps:
    - uses: actions/download-artifact@v4
      with:
        name: nightly-output
        path: output

    - working-directory: output
      run: |
        chmod +x oaf-linux-x86_64
        ./oaf-linux-x86_64 --install
        test -L ojob || test -x ojob
        ./oaf -v
        ./oaf -c 'print("ok")'
Original prompt

Goal

Add artifact smoke tests to the existing GitHub Actions build workflows in this repository, wired to run after each build job completes.

Background

The repo builds self-extracting shell scripts for OpenAF across multiple OS/arch combos (linux-x86_64, linux-arm, linux-aarch64, mac-x86_64, mac-aarch64, alpine-x86_64, alpine-aarch64). The two relevant workflows are:

  • .github/workflows/buildDaily.yaml — daily schedule; has build-nightly and build-t8 jobs
  • .github/workflows/buildStable.yaml — manual dispatch; has build-stable job

Each build job uses openaf/ojob-action@v7 to run buildNightly.yaml / buildT8.yaml / buildStable.yaml, then uploads results to S3 via ops.yaml.

Changes Required

1. Upload artifacts in each build job

In each build job (after "Prepare output" / before "Copy build result"), add an actions/upload-artifact@v4 step to upload the output/ directory. This allows the test job to consume artifacts without needing S3 credentials.

2. Add test jobs to buildDaily.yaml

Add two new test jobs:

  • test-nightly with needs: build-nightly
  • test-t8 with needs: build-t8

Each test job should:

  • Run on ubuntu-latest
  • Download the respective artifact using actions/download-artifact@v4
  • Run smoke tests on oaf-linux-x86_64 (natively available on ubuntu runner):
    • Make the binary executable: chmod +x oaf-linux-x86_64
    • Test version output: ./oaf-linux-x86_64 -v (should exit 0 and print a version string)
    • Test basic JS execution: ./oaf-linux-x86_64 -c 'print("ok")' (should print "ok")
    • Test ojob alias works after extraction: ./oaf-linux-x86_64 --install then verify ojob symlink or equivalent
  • Run Alpine artifact test using Docker (alpine:latest container) for oaf-alpine-x86_64:
    • Use a docker run step to test ./oaf-alpine-x86_64 -v inside an Alpine container

3. Add a test job to buildStable.yaml

Add test-stable with needs: build-stable, same structure as above.

4. S3 upload should still happen

The existing "Copy build result" (S3 upload) step should remain and still run after the build. The test job runs in parallel or after, but a test failure should be visible. Use if: always() or keep default behaviour so failures are reported clearly.

Notes

  • Keep all existing steps and structure intact — only add new steps and jobs.
  • Use actions/upload-artifact@v4 and actions/download-artifact@v4.
  • The artifact names should be unique per job, e.g. nightly-output, t8-output, stable-output.
  • For the smoke tests, focus on oaf-linux-x86_64 natively and oaf-alpine-x86_64 via Docker. Skip ARM/Mac for now.
  • Keep test steps simple and clear with descriptive step names.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Would it be possible to add artifact tests on this repo and wire them to the existing build GitHub actions?

Assistant: Let me explore the repository's structure and existing workflows first.

Assistant: Yes, absolutely! Here's what I found after reviewing the repo structure and existing workflows:

Current Setup

  • .github/workflows/buildDaily.yaml — Runs on a daily schedule; builds nightly and t8 variants using buildNightly.yaml / buildT8.yaml via openaf/ojob-action@v7, then uploads to S3.
  • .github/workflows/buildStable.yaml — Manual dispatch only; builds stable artifacts, uploads to S3.
  • common.yaml — Shared build logic producing self-extracting shell scripts for multiple OS/arch combos: linux-x86_64, linux-arm, linux-aarch64, mac-x86_64, mac-aarch64, alpine-x86_64, alpine-aarch64.

Proposed Artifact Test Approach

Here's a plan for adding artifact tests:

1. Upload artifacts in the build jobs

Add an actions/upload-artifact step after "Prepare output" in each build job, so the test jobs can consume them without needing S3 credentials.

2. Add a test job per workflow with needs: build-*

Wire a test job to run after the build succeeds. On the test job:

  • Download the artifact with actions/download-artifact
  • Make it executable and run basic smoke tests, e.g.:
    • ./oaf-linux-x86_64 -v — verify it extracts and prints a version
    • ./oaf-linux-x86_64 -c 'print("ok")' — verify JS execution works
    • Test that symlinks/aliases (ojob, opack, oafc) work after install
  • For ARM/aarch64, use runs-on: ubuntu-latest with QEMU (docker/setup-qemu-action) or test only linux-x86_64 natively and others with Docker.
  • For Alpine, run a Docker container (alpine:latest) to test the Alpine artifact.

3. Workflow structure example

build-nightly → test-nightly (linux-x86_64 native smoke test)
build-t8      → test-t8      (linux-x86_64 native smoke test)

Would you like me to open a pull request implementing this? A few clarifying questions first:

  1. How minimal vs thorough? Just a basic oaf -v smoke test,...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Add artifact smoke tests to GitHub Actions workflows Add artifact smoke-test jobs to daily and stable build workflows May 28, 2026
Copilot AI requested a review from nmaguiar May 28, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants