All checks were successful
MVS Upload & Execute / upload-and-run (push) Successful in 16s
81 lines
2.9 KiB
YAML
81 lines
2.9 KiB
YAML
name: MVS Upload & Execute
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
upload-and-run:
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare environment
|
|
id: setup
|
|
run: |
|
|
echo "=== Debug: Starting setup ==="
|
|
echo "Current dir: $(pwd)"
|
|
echo "Files in repo: $(ls -la)"
|
|
apt-get update && apt install -y netcat-traditional
|
|
nc -h
|
|
echo "=== Debug: Setup complete ==="
|
|
|
|
- name: Find changed source files
|
|
id: files
|
|
run: |
|
|
echo "=== Debug: Starting file detection ==="
|
|
echo "Current dir: $(pwd)"
|
|
echo "Files in repo: $(ls -la)"
|
|
echo "=== Debug: Checking for parent commit ==="
|
|
if git rev-parse --verify HEAD~1 >/dev/null 2>&1; then
|
|
echo "Parent commit exists; running git diff."
|
|
CHANGED_FILES=$(git diff --name-only HEAD~1 2>/dev/null | grep -E '\.(c|bas)$' | head -1)
|
|
echo "Changed files from last commit: '${CHANGED_FILES}'"
|
|
else
|
|
echo "No parent commit; skipping diff."
|
|
CHANGED_FILES=""
|
|
fi
|
|
echo "=== Debug: Git diff check complete ==="
|
|
|
|
# Fallback to all .c/.bas files if no changes or no previous commit
|
|
if [ -z "$CHANGED_FILES" ]; then
|
|
echo "=== Debug: No changes found; running fallback find ==="
|
|
CHANGED_FILES=$(find . -type f \( -name "*.c" -o -name "*.bas" \) | head -1)
|
|
echo "Fallback files: '${CHANGED_FILES}'"
|
|
echo "=== Debug: Fallback complete ==="
|
|
fi
|
|
|
|
if [ -z "$CHANGED_FILES" ]; then
|
|
echo "No C/BAS files found; skipping workflow."
|
|
exit 0 # Graceful skip, no failure
|
|
fi
|
|
|
|
echo "=== Debug: Processing final file ==="
|
|
echo "Final selected file: '${CHANGED_FILES}'"
|
|
echo "file=$CHANGED_FILES" >> $GITHUB_OUTPUT
|
|
|
|
# Extract member name (handle .c or .bas)
|
|
EXT="${CHANGED_FILES##*.}"
|
|
BASE=$(basename "$CHANGED_FILES" ".$EXT")
|
|
echo "member=$BASE" >> $GITHUB_OUTPUT
|
|
echo "=== Debug: File detection complete ==="
|
|
|
|
- name: Upload to PDS and Submit JCL
|
|
if: steps.files.outputs.file != ''
|
|
run: |
|
|
echo "=== Debug: Starting upload/submit ==="
|
|
echo "File: ${{ steps.files.outputs.file }}"
|
|
echo $(/usr/bin/stat ${{ steps.files.outputs.file }})
|
|
echo $(nc -h)
|
|
echo "Member: ${{ steps.files.outputs.member }}"
|
|
python3 mvs_job.py "${{ steps.files.outputs.file }}" "@05054.SRCLIB.C" "${{ steps.files.outputs.member }}" "COMPILE"
|
|
echo "=== Debug: Upload/submit complete ==="
|
|
env:
|
|
MVS_HOST: "oldcomputernerd.com"
|
|
|
|
- name: Report Status
|
|
run: |
|
|
echo "Upload/Compile complete! Check TK5 JES for JOB ${{ steps.files.outputs.member }} output."
|