-
Notifications
You must be signed in to change notification settings - Fork 12
101 lines (92 loc) · 2.96 KB
/
Copy pathBuild.yml
File metadata and controls
101 lines (92 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: BuildAndTest
on:
push:
paths:
- '**.c'
- '**.cpp'
- '**.cppm'
- '**.h'
- '**.hpp'
- '**.cmake'
- '**/CMakeLists.txt'
- 'conda/**'
- '.github/workflows/Build.yml'
- '.github/workflows/CondaPreflight.yml'
- '.github/workflows/CondaPackage.yml'
- '.github/scripts/ci/**'
pull_request:
paths:
- '**.c'
- '**.cpp'
- '**.cppm'
- '**.h'
- '**.hpp'
- '**.cmake'
- '**/CMakeLists.txt'
- 'conda/**'
- '.github/workflows/Build.yml'
- '.github/workflows/CondaPreflight.yml'
- '.github/workflows/CondaPackage.yml'
- '.github/scripts/ci/**'
workflow_dispatch:
inputs:
platforms:
# Manual override for matrix platforms, e.g. "linux-64,osx-arm64".
description: 'Comma-separated conda platforms (e.g. osx-arm64,linux-64)'
required: false
default: linux-64
concurrency:
# Include event name so push and pull_request runs do not cancel each other.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
env:
# Default platforms for automatic triggers (push/pull_request).
CI_CONDA_PLATFORMS: linux-64
jobs:
matrix:
name: Generate Source Matrix
runs-on: ubuntu-24.04
outputs:
source_matrix: ${{ steps.generate.outputs.source_matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate matrix
id: generate
run: |
# Keep variant logic in one place: .github/scripts/ci/generate_matrix.py
platforms="${{ github.event.inputs.platforms || env.CI_CONDA_PLATFORMS }}"
python3 .github/scripts/ci/generate_matrix.py \
--mode source \
--platforms "$platforms" \
--github-output "$GITHUB_OUTPUT"
build_and_test:
name: ${{ matrix.platform }} / MPI${{ matrix.mpi }} / OMP${{ matrix.openmp }} / ${{ matrix.build_type }}
runs-on: ${{ matrix.runner }}
needs: matrix
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.matrix.outputs.source_matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: latest
channels: opflow-dev,conda-forge
channel-priority: strict
activate-environment: base
auto-activate-base: true
use-mamba: true
- name: Build and test source tree
shell: bash -l {0}
run: |
# Enforces fail-fast dependency check, then builds source and runs ctest.
bash .github/scripts/ci/run_source_job.sh \
--mpi "${{ matrix.mpi }}" \
--openmp "${{ matrix.openmp }}" \
--build-type "${{ matrix.build_type }}" \
--owner opflow-dev \
--platform "${{ matrix.platform }}"