Skip to content

refactor CI into subfolders #156

refactor CI into subfolders

refactor CI into subfolders #156

Workflow file for this run

name: CI
on:
pull_request:
jobs:
# Build jobs - create libraries once for each SST version and share as artifacts
build:
runs-on: ${{ matrix.architecture.runner }}
strategy:
matrix: &test-matrix
sst_version:
- { tag: "15.1.2", image: "ghcr.io/hpc-ai-adv-dev/sst-core:15.1.2" }
- { tag: "16.0.0", image: "ghcr.io/hpc-ai-adv-dev/sst-core:16.0.0" }
- { tag: "master", image: "ghcr.io/hpc-ai-adv-dev/sst-core:master-latest" }
experiment:
- { id: "gameoflife", path: "gameoflife" }
- { id: "pingpong", path: "pingpong" }
- { id: "phold", path: "phold" }
architecture:
- { name: "x86_64", runner: "ubuntu-latest" }
- { name: "arm64", runner: "ubuntu-24.04-arm" }
container:
image: ${{ matrix.sst_version.image }}
steps:
- uses: actions/checkout@v4
- name: Build ${{ matrix.experiment.id }} library
run: |
cd ${{ matrix.experiment.path }}
make
- name: Upload ${{ matrix.experiment.id }} library
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.experiment.id }}-lib-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: ${{ matrix.experiment.path }}/lib*.so
retention-days: 1
# Test jobs - use pre-built libraries
test:
runs-on: ${{ matrix.architecture.runner }}
needs: build
strategy:
matrix: *test-matrix
container:
image: ${{ matrix.sst_version.image }}
steps:
- uses: actions/checkout@v4
- name: Download ${{ matrix.experiment.id }} library
uses: actions/download-artifact@v4
with:
name: ${{ matrix.experiment.id }}-lib-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: ${{ matrix.experiment.path }}/
- name: Run ${{ matrix.experiment.id }} test
run: |
./.github/ci/experiments/${{ matrix.experiment.id }}/test.sh "${{ matrix.experiment.path }}" "${{ matrix.sst_version.tag }}"
# PHOLD AHP testing jobs - install Python dependency and compare AHP output to baseline
phold-ahp:
runs-on: ${{ matrix.architecture.runner }}
needs: build
strategy:
matrix:
sst_version:
- { tag: "15.1.2", image: "ghcr.io/hpc-ai-adv-dev/sst-core:15.1.2" }
- { tag: "16.0.0", image: "ghcr.io/hpc-ai-adv-dev/sst-core:16.0.0" }
- { tag: "master", image: "ghcr.io/hpc-ai-adv-dev/sst-core:master-latest" }
architecture:
- { name: "x86_64", runner: "ubuntu-latest" }
- { name: "arm64", runner: "ubuntu-24.04-arm" }
container:
image: ${{ matrix.sst_version.image }}
steps:
- uses: actions/checkout@v4
- name: Download phold library
uses: actions/download-artifact@v4
with:
name: phold-lib-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: phold/
- name: Install AHP Python dependency
run: |
apt-get install -y libtool \
libtool-bin \
graphviz \
libgraphviz-dev
python3 -m pip install --no-cache-dir git+https://github.com/lpsmodsimteam/ahp_graph.git
- name: Run phold AHP test
run: |
./.github/ci/experiments/phold/ahp-test.sh phold "${{ matrix.sst_version.tag }}"
# Checkpoint testing jobs - run with checkpoint enabled
checkpoint:
runs-on: ${{ matrix.architecture.runner }}
needs: build
strategy:
matrix: *test-matrix
container:
image: ${{ matrix.sst_version.image }}
steps:
- uses: actions/checkout@v4
- name: Download ${{ matrix.experiment.id }} library
uses: actions/download-artifact@v4
with:
name: ${{ matrix.experiment.id }}-lib-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: ${{ matrix.experiment.path }}/
- name: Run ${{ matrix.experiment.id }} with checkpoint enabled
run: |
./.github/ci/experiments/${{ matrix.experiment.id }}/checkpoint.sh "${{ matrix.experiment.path }}" "${{ matrix.sst_version.tag }}"
cd ${{ matrix.experiment.path }}
echo "=== Verifying checkpoint files were created ==="
ls -la checkpoint_*/ || echo "No checkpoint directory found"
- name: Upload checkpoint artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.experiment.id }}-checkpoint-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: ${{ matrix.experiment.path }}/checkpoint/
retention-days: 1
# Checkpoint restore testing jobs - restore from checkpoint
restore:
runs-on: ${{ matrix.architecture.runner }}
needs: checkpoint
strategy:
matrix: *test-matrix
container:
image: ${{ matrix.sst_version.image }}
steps:
- uses: actions/checkout@v4
- name: Download ${{ matrix.experiment.id }} library
uses: actions/download-artifact@v4
with:
name: ${{ matrix.experiment.id }}-lib-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: ${{ matrix.experiment.path }}/
- name: Download checkpoint artifacts
uses: actions/download-artifact@v4
with:
name: ${{ matrix.experiment.id }}-checkpoint-${{ matrix.sst_version.tag }}-${{ matrix.architecture.name }}
path: ${{ matrix.experiment.path }}/checkpoint/
- name: Restore ${{ matrix.experiment.id }} from checkpoint
run: |
./.github/ci/experiments/${{ matrix.experiment.id }}/restore.sh "${{ matrix.experiment.path }}" "${{ matrix.sst_version.tag }}"
cd ${{ matrix.experiment.path }}
echo "=== Verifying simulation completed successfully ==="
grep -q "Simulation is complete" *_restore.out