Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CI workflows #1798

Merged
merged 32 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d3aa85b
Disable existing test workflow.
joaander Jun 5, 2024
ee0864f
1:1 mapping of jinja workflow to reusable workflows
joaander Jun 5, 2024
e867cd0
Test on GitHub provided runners for now.
joaander Jun 5, 2024
ce06d81
Attempt to improve job names.
joaander Jun 5, 2024
8cf8cb6
Remove duplicate and add release tests.
joaander Jun 5, 2024
8f9d932
Add final test gate.
joaander Jun 5, 2024
1d99df1
Attempt to restore missing jobs.
joaander Jun 5, 2024
357a5e9
Combine validate and pytest.
joaander Jun 6, 2024
3893e85
GitHub provided runner fallback.
joaander Jun 6, 2024
49addb0
Trigger CI.
joaander Jun 6, 2024
6727559
Debug testing build_runner.
joaander Jun 6, 2024
87bd722
Attempt to fix dynamic runner selection.
joaander Jun 6, 2024
2c47d88
Label validation tests more clearly.
joaander Jun 6, 2024
0ca269c
Use tagged jetstream2-admin
joaander Jun 6, 2024
bf2074e
Remove the now unused make_workflows and templates.
joaander Jun 6, 2024
9e970fb
Switch to shared stale bot configuration.
joaander Jun 6, 2024
8566a85
Refactor release workflow.
joaander Jun 6, 2024
ea3e878
Remove debug code.
joaander Jun 6, 2024
0840193
Update GitHub actions with dependabot.
joaander Jun 6, 2024
882f17e
Run pre-commit.
joaander Jun 6, 2024
feeedea
Pass full image name to reusable workflow.
joaander Jun 6, 2024
e39b013
Document currently tested compilers.
joaander Jun 6, 2024
bd5d505
Remove template specifier on constructors and destructors.
joaander Jun 6, 2024
ebd5581
Use std::vector for variable MPI request arrays.
joaander Jun 6, 2024
2d6e6ce
Fix more variable arrays.
joaander Jun 6, 2024
43e20cd
Fix an uninitialized variable warning.
joaander Jun 6, 2024
0d7b909
Fix more uses of VLAs.
joaander Jun 6, 2024
c03d8cb
Inline much of the convex polyhedron overlap code.
joaander Jun 10, 2024
d1dbc61
Replace scratchpad array with statically sized one.
joaander Jun 10, 2024
b16a9e9
Run pre-commit.
joaander Jun 10, 2024
e6eaf30
Fix VLA usage in PotentialTersoff.h.
joaander Jun 10, 2024
5adc61c
Test the latest compilers in the typical build configurations.
joaander Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
target-branch: trunk-patch
schedule:
interval: "monthly"
time: "07:00"
timezone: "EST5EDT"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 2
reviewers:
- joaander
groups:
actions-version:
applies-to: version-updates
patterns:
- '*'
actions-security:
applies-to: security-updates
patterns:
- '*'
- package-ecosystem: "pip"
directory: "/"
target-branch: trunk-patch
Expand Down
242 changes: 242 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
name: Build and test

on:
workflow_call:
inputs:
config:
type: string
required: true
image:
type: string
required: true
build_runner:
type: string
required: true
default: ubuntu-latest
test_runner:
type: string
required: true
default: ubuntu-latest
test_docker_options:
type: string
required: false
validate:
type: string
required: false

env:
# prevent deadlocked MPI tests from causing the job to cancel
MPIEXEC_TIMEOUT: 3000
# allow mpirun to execute as root in the tests
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
# allow openmpi to oversubscribe cores
OMPI_MCA_rmaps_base_oversubscribe: 1
# prevent errors from mis-configured openib systems
OMPI_MCA_btl: "vader,self"
# skip running the CPU tests in GPU builds
_HOOMD_SKIP_CPU_TESTS_WHEN_GPUS_PRESENT_: 1
# Require GPU tests in GPU builds.
_HOOMD_REQUIRE_GPU_TESTS_IN_GPU_BUILDS_: 1
# import HOOMD out of the build directory
PYTHONPATH: ${{ github.workspace }}/install

jobs:
build:
runs-on: ${{ fromJson(inputs.build_runner) }}
container:
image: ${{ inputs.image == '' && null || inputs.image }}

steps:
- name: Set Werror on recent compilers
run: |
echo "CXXFLAGS=-Werror" >> $GITHUB_ENV
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: code
submodules: true

- name: Configure
run: |
if [[ ${BUILD_DEBUG} == "true" ]]; then BUILD_TYPE="Debug"; else BUILD_TYPE="Release"; fi
echo "BUILD_TYPE=${BUILD_TYPE}"
cmake -S code -B build -GNinja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_GPU=${ENABLE_GPU:-"OFF"} \
-DENABLE_MPI=${ENABLE_MPI:-"OFF"} \
-DENABLE_TBB=${ENABLE_TBB:-"OFF"} \
-DENABLE_LLVM=${ENABLE_LLVM:-"OFF"} \
-DBUILD_MD=${BUILD_MD:-"ON"} \
-DBUILD_MPCD=${BUILD_MD:-"ON"} \
-DBUILD_METAL=${BUILD_MD:-"ON"} \
-DBUILD_HPMC=${BUILD_HPMC:-"ON"} \
-DCUDA_ARCH_LIST="60;70" \
-DENABLE_DEBUG_JIT=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DPLUGINS=""
env:
ENABLE_GPU: ${{ contains(inputs.config, 'cuda') }}
ENABLE_MPI: ${{ contains(inputs.config, 'mpi') }}
ENABLE_TBB: ${{ contains(inputs.config, 'tbb') }}
ENABLE_LLVM: ${{ contains(inputs.config, 'llvm') }}
BUILD_MD: ${{ !contains(inputs.config, 'nomd') }}
BUILD_HPMC: ${{ !contains(inputs.config, 'nohpmc') }}
BUILD_DEBUG: ${{ contains(inputs.config, 'debug') }}
shell: bash

- name: Build
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2)) -k 0
working-directory: build

- name: Configure plugins
run : |
if [[ ${BUILD_DEBUG} == "true" ]]; then BUILD_TYPE="Debug"; else BUILD_TYPE="Release"; fi
echo "BUILD_TYPE=${BUILD_TYPE}"
CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install cmake -S code/example_plugins -B build-example-plugins -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
env:
BUILD_DEBUG: ${{ contains(inputs.config, 'debug') }}
shell: bash

- name: Build plugins
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2)) -k 0
working-directory: build-example-plugins

- name: Remove object files
run: find build -type f -name '*.o' -delete

- name: 'Tar build'
run: tar --use-compress-program='zstd -10 -T0' -cvf build.tar build

- name: 'Tar install'
run: tar --use-compress-program='zstd -10 -T0' -cvf install.tar install

- name: 'Upload build'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: build-${{ inputs.config }}-${{ github.sha }}
path: build.tar
retention-days: 7
- name: 'Upload install'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: install-${{ inputs.config }}-${{ github.sha }}
path: install.tar
retention-days: 7

- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash


pytest:
needs: build
runs-on: ${{ fromJson(inputs.test_runner) }}
container:
image: ${{ inputs.image == '' && null || inputs.image }}
options: ${{ inputs.test_docker_options }} -e CUDA_VISIBLE_DEVICES

steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: code
submodules: true

- name: Download install
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: install-${{ inputs.config }}-${{ github.sha }}
- name: Untar install
run: tar --use-compress-program='zstd -10 -T0' -xvf install.tar

### Unit tests
- name: Run pytest (serial)
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1

- name: Run pytest (mpi)
if: ${{ contains(inputs.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 || (( cat pytest.out.1 && exit 1 ))

- name: Run pytest (serial without cupy)
if: ${{ contains(inputs.config, 'cuda') }}
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -m cupy_optional
env:
_HOOMD_DISALLOW_CUPY_: 1

- name: Run pytest (mpi without cupy)
if: ${{ contains(inputs.config, 'cuda') && contains(inputs.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -m cupy_optional || (( cat pytest.out.1 && exit 1 ))
env:
_HOOMD_DISALLOW_CUPY_: 1

### Validation tests
- name: Run pytest -m validate (serial)
if: ${{ !contains(inputs.config, 'mpi') && contains(github.event.pull_request.labels.*.name, 'validate') && inputs.validate == 'true' }}
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -p hoomd.pytest_plugin_validate -m validate --validate

- name: Run pytest -m validate (mpi)
if: ${{ contains(inputs.config, 'mpi') && contains(github.event.pull_request.labels.*.name, 'validate') && inputs.validate == 'true' }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -p hoomd.pytest_plugin_validate -m validate --validate || (( cat pytest.out.1 && exit 1 ))

- name: Run howto guides (serial)
if: ${{ contains(inputs.config, 'llvm') && contains(github.event.pull_request.labels.*.name, 'validate') && inputs.validate == 'true' }} # some examples require LLVM
run: 'for i in *.py; do echo "Running howto: $i" && python3 $i || exit 1; done'
working-directory: code/sphinx-doc/howto

- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash


ctest:
needs: build
runs-on: ${{ fromJson(inputs.test_runner) }}
container:
image: ${{ inputs.image == '' && null || inputs.image }}
options: ${{ inputs.test_docker_options }} -e CUDA_VISIBLE_DEVICES

steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: code
submodules: true

- name: Download build
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: build-${{ inputs.config }}-${{ github.sha }}
- name: Untar build
run: tar --use-compress-program='zstd -10 -T0' -xvf build.tar

- name: Run tests
run: >-
ctest
-T test
--output-on-failure
--test-output-size-failed 1048576
--test-output-size-passed 1048576
working-directory: build

- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
56 changes: 0 additions & 56 deletions .github/workflows/make_workflows.py

This file was deleted.

Loading