refactor CI into subfolders #154
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }}" | |
| # 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 |