|
| 1 | +name: Bootstrap ya-bin |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + paths: ['devtools/ya/bootstrap/graph.json'] |
| 7 | + workflow_dispatch: # allow manual runs for debugging |
| 8 | + |
| 9 | +jobs: |
| 10 | + bootstrap: |
| 11 | + runs-on: self-hosted |
| 12 | + if: github.ref == 'refs/heads/main' |
| 13 | + timeout-minutes: 180 |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout repository |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Run bootstrap (stage 1 + stage 2) |
| 20 | + run: | |
| 21 | + mkdir -p "$RUNNER_TEMP/ya-bootstrap-result" |
| 22 | + python3 devtools/ya/bootstrap/run_bootstrap.py \ |
| 23 | + --source-root "$GITHUB_WORKSPACE" \ |
| 24 | + --result-root "$RUNNER_TEMP/ya-bootstrap-result" \ |
| 25 | + --all-platforms-build \ |
| 26 | + --cleanup |
| 27 | +
|
| 28 | + - name: Verify stage 1 artifacts |
| 29 | + run: | |
| 30 | + set -euo pipefail |
| 31 | +
|
| 32 | + STAGE1="$RUNNER_TEMP/ya-bootstrap-result/stage1" |
| 33 | +
|
| 34 | + echo "=== Checking stage1 artifacts in $STAGE1 ===" |
| 35 | +
|
| 36 | + for bin in ya-bin ymake; do |
| 37 | + path="$STAGE1/$bin" |
| 38 | +
|
| 39 | + if [ ! -f "$path" ]; then |
| 40 | + echo "ERROR: $path not found" |
| 41 | + exit 1 |
| 42 | + fi |
| 43 | +
|
| 44 | + echo "--- Running $bin --help ---" |
| 45 | + "$path" --help |
| 46 | + echo "OK: $bin exited with code $?" |
| 47 | + done |
| 48 | +
|
| 49 | + - name: Verify stage 2 artifacts |
| 50 | + run: | |
| 51 | + set -euo pipefail |
| 52 | +
|
| 53 | + STAGE2="$RUNNER_TEMP/ya-bootstrap-result/stage2" |
| 54 | + PLATFORM_LIST="$GITHUB_WORKSPACE/devtools/ya/bootstrap/platform_list" |
| 55 | +
|
| 56 | + MAIN_BINS="ya-bin ymake ya-tc" |
| 57 | + EXISTENCE_ONLY_BINS="test_tool" |
| 58 | + ADDITIONAL_BINS="yexport" |
| 59 | +
|
| 60 | + LINUX_X86_PLATFORM="default-linux-x86_64" |
| 61 | +
|
| 62 | + echo "=== Checking stage2 artifacts in $STAGE2 ===" |
| 63 | +
|
| 64 | + while IFS= read -r platform || [ -n "$platform" ]; do |
| 65 | + [ -z "$platform" ] && continue |
| 66 | + echo "--- Platform: $platform ---" |
| 67 | +
|
| 68 | + # Check main binaries exist |
| 69 | + for bin in $MAIN_BINS; do |
| 70 | + path="$STAGE2/$platform/$bin" |
| 71 | + if [ ! -f "$path" ]; then |
| 72 | + echo "ERROR: $path not found" |
| 73 | + exit 1 |
| 74 | + fi |
| 75 | + echo "EXISTS: $path" |
| 76 | + done |
| 77 | +
|
| 78 | + # Check existence-only binaries (no --help) |
| 79 | + for bin in $EXISTENCE_ONLY_BINS; do |
| 80 | + path="$STAGE2/$platform/$bin" |
| 81 | + if [ ! -f "$path" ]; then |
| 82 | + echo "ERROR: $path not found" |
| 83 | + exit 1 |
| 84 | + fi |
| 85 | + echo "EXISTS: $path" |
| 86 | + done |
| 87 | +
|
| 88 | + # Check additional binaries exist (no --help) |
| 89 | + for bin in $ADDITIONAL_BINS; do |
| 90 | + path="$STAGE2/additional/$platform/$bin" |
| 91 | + if [ ! -f "$path" ]; then |
| 92 | + echo "ERROR: $path not found" |
| 93 | + exit 1 |
| 94 | + fi |
| 95 | + echo "EXISTS: $path" |
| 96 | + done |
| 97 | +
|
| 98 | + # For linux-x86_64 also run --help and check exit code |
| 99 | + if [ "$platform" = "$LINUX_X86_PLATFORM" ]; then |
| 100 | + echo "--- Running --help checks for $platform ---" |
| 101 | +
|
| 102 | + for bin in $MAIN_BINS; do |
| 103 | + path="$STAGE2/$platform/$bin" |
| 104 | + echo "Running: $path --help" |
| 105 | + "$path" --help |
| 106 | + echo "OK: $bin exited with code $?" |
| 107 | + done |
| 108 | + fi |
| 109 | +
|
| 110 | + done < "$PLATFORM_LIST" |
| 111 | +
|
| 112 | + - name: Cleanup podman containers and images |
| 113 | + if: always() |
| 114 | + run: | |
| 115 | + podman system reset -f |
0 commit comments