Skip to content

Commit 3c88431

Browse files
committed
Debugging: try reusable workflows
1 parent 08d6fc2 commit 3c88431

File tree

2 files changed

+79
-76
lines changed

2 files changed

+79
-76
lines changed

.github/workflows/check_diff.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: PR analysis
22

33
on:
4+
workflow_call:
5+
outputs:
6+
skip: { type: boolean, description: "Whether to skip dependent CI checks" }
47
pull_request:
58

69
concurrency:
@@ -32,6 +35,7 @@ jobs:
3235
run: |
3336
git diff --name-only --diff-filter=ACMRTUXB origin/${BASE_REF}..fork/${HEAD_REF} > check_diff.txt
3437
- name: Check files changed
38+
id: check
3539
run: |
3640
if grep -v -E "^(Docs|\.github)/|\.azure-pipelines\.yml$" check_diff.txt; then
3741
echo "skip=false"

.github/workflows/macos.yml

+75-76
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
name: 🍏 macOS
22

33
on:
4-
push:
5-
branches:
6-
- "development"
7-
workflow_run:
8-
workflows: [PR analysis]
9-
types:
10-
- completed
4+
pull_request:
115

126
concurrency:
137
group: ${{ github.ref }}-${{ github.head_ref }}-macos
@@ -17,78 +11,83 @@ jobs:
1711
build_appleclang:
1812
name: AppleClang
1913
runs-on: macos-latest
20-
#if: ${{ github.event.pull_request.draft == false && github.event.workflow_run.outputs.skip == "false" }}
21-
env:
22-
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE
23-
# For macOS, Ninja is slower than the default:
24-
#CMAKE_GENERATOR: Ninja
2514
steps:
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-python@v5
28-
name: Install Python
29-
with:
30-
python-version: '3.x'
31-
- name: install brew dependencies
32-
run: |
33-
set +e
34-
brew unlink gcc
35-
brew update
36-
brew upgrade || true
37-
brew install ccache
38-
brew install fftw
39-
brew install libomp
40-
brew link --overwrite --force libomp
41-
brew install ninja
42-
brew install open-mpi
43-
brew install pkg-config
44-
set -e
45-
brew tap openpmd/openpmd
46-
brew install openpmd-api
47-
- name: install pip dependencies
48-
run: |
49-
python3 -m pip install --upgrade pip
50-
python3 -m pip install --upgrade build packaging setuptools wheel
51-
python3 -m pip install --upgrade mpi4py
52-
python3 -m pip install --upgrade -r Regression/requirements.txt
53-
- name: CCache Cache
54-
uses: actions/cache@v4
55-
with:
56-
path: ~/Library/Caches/ccache
57-
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
58-
restore-keys: |
59-
ccache-${{ github.workflow }}-${{ github.job }}-git-
60-
- name: build WarpX
61-
run: |
62-
export CCACHE_COMPRESS=1
63-
export CCACHE_COMPRESSLEVEL=10
64-
export CCACHE_MAXSIZE=100M
65-
export CCACHE_SLOPPINESS=time_macros
66-
ccache -z
15+
- name: Run PR analysis
16+
uses: ./.github/workflows/pr-analysis.yml
17+
id: pr_analysis
18+
- name: Checkout code
19+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
20+
uses: actions/checkout@v4
21+
- name: Install Python
22+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.x'
26+
- name: Install brew dependencies
27+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
28+
run: |
29+
set +e
30+
brew unlink gcc
31+
brew update
32+
brew upgrade || true
33+
brew install ccache
34+
brew install fftw
35+
brew install libomp
36+
brew link --overwrite --force libomp
37+
brew install ninja
38+
brew install open-mpi
39+
brew install pkg-config
40+
set -e
41+
brew tap openpmd/openpmd
42+
brew install openpmd-api
43+
- name: Install pip dependencies
44+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
45+
run: |
46+
python3 -m pip install --upgrade pip
47+
python3 -m pip install --upgrade build packaging setuptools wheel
48+
python3 -m pip install --upgrade mpi4py
49+
python3 -m pip install --upgrade -r Regression/requirements.txt
50+
- name: CCache Cache
51+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
52+
uses: actions/cache@v4
53+
with:
54+
path: ~/Library/Caches/ccache
55+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
56+
restore-keys: |
57+
ccache-${{ github.workflow }}-${{ github.job }}-git-
58+
- name: Build WarpX
59+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
60+
run: |
61+
export CCACHE_COMPRESS=1
62+
export CCACHE_COMPRESSLEVEL=10
63+
export CCACHE_MAXSIZE=100M
64+
export CCACHE_SLOPPINESS=time_macros
65+
ccache -z
6766
68-
export CXXFLAGS="-Werror -Wno-error=pass-failed"
67+
export CXXFLAGS="-Werror -Wno-error=pass-failed"
6968
70-
cmake -S . -B build_dp \
71-
-DCMAKE_VERBOSE_MAKEFILE=ON \
72-
-DWarpX_EB=OFF \
73-
-DWarpX_OPENPMD=ON \
74-
-DWarpX_openpmd_internal=OFF
75-
cmake --build build_dp -j 3
69+
cmake -S . -B build_dp \
70+
-DCMAKE_VERBOSE_MAKEFILE=ON \
71+
-DWarpX_EB=OFF \
72+
-DWarpX_OPENPMD=ON \
73+
-DWarpX_openpmd_internal=OFF
74+
cmake --build build_dp -j 3
7675
77-
cmake -S . -B build_sp \
78-
-DCMAKE_VERBOSE_MAKEFILE=ON \
79-
-DWarpX_EB=OFF \
80-
-DWarpX_PYTHON=ON \
81-
-DWarpX_OPENPMD=ON \
82-
-DWarpX_openpmd_internal=OFF \
83-
-DWarpX_PRECISION=SINGLE
84-
cmake --build build_sp -j 3
85-
cmake --build build_sp --target pip_install
76+
cmake -S . -B build_sp \
77+
-DCMAKE_VERBOSE_MAKEFILE=ON \
78+
-DWarpX_EB=OFF \
79+
-DWarpX_PYTHON=ON \
80+
-DWarpX_OPENPMD=ON \
81+
-DWarpX_openpmd_internal=OFF \
82+
-DWarpX_PRECISION=SINGLE
83+
cmake --build build_sp -j 3
84+
cmake --build build_sp --target pip_install
8685
87-
du -hs ~/Library/Caches/ccache
88-
ccache -s
86+
du -hs ~/Library/Caches/ccache
87+
ccache -s
88+
- name: Run pywarpx
89+
if: ${{ github.event.pull_request.draft == false && steps.pr_analysis.outputs.skip == "false" }}
90+
run: |
91+
export OMP_NUM_THREADS=1
8992
90-
- name: run pywarpx
91-
run: |
92-
export OMP_NUM_THREADS=1
93-
94-
mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py
93+
mpirun -n 2 Examples/Physics_applications/laser_acceleration/inputs_test_3d_laser_acceleration_picmi.py

0 commit comments

Comments
 (0)