diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 00000000000000..1073d8d47fe5a8 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,107 @@ +name: integration tests + +on: + workflow_dispatch: + workflow_call: + pull_request: + branches: + - develop + - releases/** + +concurrency: + group: intergrations-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} + cancel-in-progress: true + +jobs: + scan: + runs-on: ubuntu-latest + outputs: + packages: ${{ steps.scan.outputs.packages }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + fetch-depth: 0 + - name: "Add Integration test repo" + run: | + . share/spack/setup-env.sh + spack repo add https://github.com/johnwparent/test-spack-smoke-repo.git + - name: "List repo packages" + id: scan + run: | + . share/spack/setup-env.sh + packages_list="$(spack list --repo smoketest | python3 -c "import sys; print([f'"{x}"' for x in sys.stdin.read().split('\n') if x])")" + echo "packages=${packages_list}" >> "$GITHUB_OUTPUT" + + run-nix: + needs: [scan] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-13, macos-14] + package: ${{ fromJSON(needs.scan.outputs.packages) }} # list of spack intergration test packages to run + fail-fast: true + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + fetch-depth: 0 + - name: "Add Integration test repo" + run: | + . share/spack/setup-env.sh + spack repo add https://github.com/johnwparent/test-spack-smoke-repo.git + - name: "Spack install" + id: install + run: | + . share/spack/setup-env.sh + spack compiler find + spack external find cmake ninja + spack -dv install --test root ${{ matrix.package }} + - name: "Determine failure stage" + if: always() && (steps.install.outcome == 'failure') + run: | + . share/spack/setup-env.sh + echo "FAILURE_STAGE=$(spack location -s ${{ matrix.package }})" >> $GITHUB_ENV + + - name: "Collect failure artifacts" + if: always() && (steps.install.outcome == 'failure') + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.package }}-stage" + path: $FAILURE_STAGE + + + + run-win: + defaults: + run: + shell: + powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0} + needs: [scan] + runs-on: windows-latest + strategy: + matrix: + package: ${{ fromJSON(needs.scan.outputs.packages) }} # list of spack intergration test packages to run + fail-fast: true + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + fetch-depth: 0 + - name: "Add Integration test repo" + run: | + spack repo add https://github.com/johnwparent/test-spack-smoke-repo.git + - name: "Spack install" + id: install + run: | + spack compiler find + spack external find cmake ninja + spack -dv install --test root ${{ matrix.package }} + - name: "Determine failure stage" + if: always() && (steps.install.outcome == 'failure') + run: | + echo "FAILURE_STAGE=$(spack location -s ${{ matrix.package }})" >> $GITHUB_ENV + + - name: "Collect failure artifacts" + if: always() && (steps.install.outcome == 'failure') + uses: actions/upload-artifact@v4 + with: + name: "${{ matrix.package }}-stage" + path: $FAILURE_STAGE \ No newline at end of file