Skip to content

Commit

Permalink
Merge pull request #1 from UCBoulder/maint/enable-github-actions
Browse files Browse the repository at this point in the history
MAINT: Initial commit to enable github actions
  • Loading branch information
NateAM authored Dec 15, 2023
2 parents 1cedb22 + 91f32f5 commit 134150f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/github-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Tests on pull request
run-name: ${{ github.actor }} is testing a pull request
on:
pull_request:
types:
- opened
- edited
- synchronize
branches:
- dev
- main
jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
matrix:
os: [ubuntu-latest]
build_type: [Release]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: MiniConda setup
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
channels: conda-forge,defaults
channel-priority: true
auto-activate-base: false
activate-environment: "test-environment"
- name: check solution
run: |
conda env export
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "environment-file=${{ github.workspace }}/reduced_environment.txt" >> "$GITHUB_OUTPUT"
echo "moose-dir=${{ github.workspace }}/moose-dir" >> "$GITHUB_OUTPUT"
- name: Conda environment
shell: bash -el {0}
run: |
mamba install --file ${{ steps.strings.outputs.environment-file }} --yes --channel conda-forge
- name: Build
shell: bash -el {0}
run: |
mkdir build
cd build
cmake .. -DTARDIGRADE_STRESS_TOOLS_BUILD_PYTHON_BINDINGS=OFF
make
- name: Test
shell: bash -el {0}
# working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: |
conda activate test-environment
cd build
ctest
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ include(FetchContent)
set(upstream_packages "tardigrade_error_tools" "tardigrade_vector_tools" "tardigrade_constitutive_tools")
foreach(package ${upstream_packages})
string(TOUPPER "${package}" package_upper)
set(${package_upper}_BUILD_PYTHON_BINDINGS ${TARDIGRADE_STRESS_TOOLS_BUILD_PYTHON_BINDINGS})
set(${package_upper}_BUILD_PYTHON_BINDINGS ${TARDIGRADE_STRESS_TOOLS_BUILD_PYTHON_BINDINGS} CACHE INTERNAL "Setting ${package}'s python binding flag to the global value")
find_package(${package} ${upstream_required} CONFIG)
if(${package}_FOUND)
message(STATUS "Found ${package}: ${${package}_DIR}")
Expand All @@ -98,7 +98,7 @@ foreach(package ${upstream_packages})
# TODO: Decide how to handle main/dev build differences. bash env variables for GIT TAG?
FetchContent_Declare(
${package}
GIT_REPOSITORY ssh://[email protected]:10022/aea/material-models/${package}.git
GIT_REPOSITORY http://github.com/UCBoulder/${package}.git
GIT_TAG origin/dev
)
FetchContent_MakeAvailable(${package})
Expand Down
10 changes: 10 additions & 0 deletions reduced_environment.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
boost>=1.59
breathe>=4.30.0
cmake>=3.18
doxygen>=1.9
eigen>=3.3.7
compilers
setuptools_scm>=6.2
sphinx>=3.0.4
sphinx_rtd_theme>=0.4.3
sphinxcontrib-bibtex

0 comments on commit 134150f

Please sign in to comment.