[WIP] Unit Test for dashboard #901
Workflow file for this run
This file contains 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: 🔄 Update Stub Files | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.ref }}-${{ github.head_ref }}-subs | |
cancel-in-progress: true | |
jobs: | |
# Build and install libamrex as AMReX CMake project | |
stubs: | |
name: Stubs | |
runs-on: ubuntu-22.04 | |
env: | |
CC: gcc | |
CXX: g++ | |
CXXFLAGS: "-O1" | |
OMP_NUM_THREAD: 4 | |
steps: | |
- uses: actions/checkout@v4 | |
if: github.event_name != 'push' || github.repository != 'ECP-WarpX/impactx' || github.ref != 'refs/heads/development' | |
- uses: actions/checkout@v4 | |
if: github.event_name == 'push' && github.repository == 'ECP-WarpX/impactx' && github.ref == 'refs/heads/development' | |
with: | |
token: ${{ secrets.IMPACTX_PUSH_TOKEN }} | |
- name: Pull Remote Changes | |
if: github.event_name == 'push' && github.repository == 'ECP-WarpX/impactx' && github.ref == 'refs/heads/development' | |
run: git pull | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.9' | |
- name: Dependencies | |
run: | | |
.github/workflows/dependencies/gcc-openmpi.sh | |
python3 -m pip install -U pybind11-stubgen | |
python3 -m pip install seleniumbase pytest | |
# Added: Install Firefox and geckodriver | |
- name: Install Browser Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y firefox-esr xvfb | |
wget https://github.com/mozilla/geckodriver/releases/download/v0.33.0/geckodriver-v0.33.0-linux64.tar.gz | |
tar -xzf geckodriver-v0.33.0-linux64.tar.gz | |
sudo mv geckodriver /usr/local/bin/ | |
sudo chmod +x /usr/local/bin/geckodriver | |
# Added: Start virtual display | |
- name: Start Virtual Display | |
run: | | |
Xvfb :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
echo "DISPLAY=:99" >> $GITHUB_ENV | |
- name: Set Up Cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ccache | |
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }} | |
restore-keys: | | |
ccache-${{ github.workflow }}-${{ github.job }}-git- | |
- name: Build & Install | |
run: | | |
export CCACHE_COMPRESS=1 | |
export CCACHE_COMPRESSLEVEL=10 | |
export CCACHE_MAXSIZE=200M | |
ccache -z | |
cmake -S . -B build \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DImpactX_FFT=ON \ | |
-DImpactX_PYTHON=ON \ | |
-DMPIEXEC_POSTFLAGS="--use-hwthread-cpus" | |
cmake --build build -j 4 --target pip_install | |
ccache -s | |
du -hs ~/.cache/ccache | |
- name: Update Stubs | |
run: | | |
.github/update_stub.sh | |
- name: Run pre-commit cleanup | |
run: | | |
git add . | |
pre-commit run -a || true | |
git add . | |
- name: Update Install | |
run: | | |
cmake --build build -j 4 --target pip_install | |
- name: Unit tests | |
run: | | |
export DISPLAY=:99 | |
mpiexec -np 1 python3 -m pytest -v tests/python/ | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
name: Commit Updated Stub Files | |
if: github.event_name == 'push' && github.repository == 'ECP-WarpX/impactx' && github.ref == 'refs/heads/development' | |
with: | |
commit_message: Update Stub Files |