diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6cd6c0..c3e16c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,84 +1,81 @@ name: CI on: workflow_dispatch: pull_request: push: branches: - master jobs: default-shell: strategy: fail-fast: false matrix: runs-on: [ubuntu-latest, macos-latest, windows-latest] + include: + - runs-on: ubuntu-latest + config: -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON + conda: environment.yaml + - runs-on: macos-latest + config: -DBUILD_TESTS=ON -DBUILD_EXAMPLES=OFF + conda: environment_no-examples.yaml + - runs-on: windows-latest + config: -DBUILD_TESTS=ON -DBUILD_EXAMPLES=OFF + conda: environment_no-examples.yaml defaults: run: shell: bash -l {0} name: "${{ matrix.runs-on }} • x64 ${{ matrix.args }}" runs-on: ${{ matrix.runs-on }} steps: - name: Basic GitHub action setup uses: actions/checkout@v2 - name: Set conda environment "test" uses: conda-incubator/setup-miniconda@v2 with: mamba-version: "*" channels: conda-forge,defaults channel-priority: true - environment-file: environment.yaml + environment-file: ${{ matrix.conda }} activate-environment: test auto-activate-base: false - - name: (Windows) Use clang instead of MSVC - if: runner.os == 'Windows' - run: conda install -c conda-forge clang-11 - - - name: Extending conda environment for testing - run: conda env update --file environment_test.yaml - - - name: Extending conda environment to run examples - if: runner.os == 'Linux' - run: conda env update --file environment_examples.yaml + - name: Configure using CMake + if: runner.os != 'Windows' + run: cmake . ${{ matrix.config }} - - name: Configure using CMake (with examples) - if: runner.os == 'Linux' - run: cmake . -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON - - - name: Configure using CMake (without examples) - if: runner.os == 'macOS' - run: cmake . -DBUILD_TESTS=ON -DBUILD_EXAMPLES=OFF - - - name: Configure using CMake (without examples, using clang) + - name: Configure using CMake (Windows) if: runner.os == 'Windows' - run: cmake . -DBUILD_TESTS=ON -DBUILD_EXAMPLES=OFF -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl + run: | + conda install -c conda-forge clang_win-64 ninja + cmake . -G Ninja ${{ matrix.config }} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ - name: Build C++ tests & examples run: cmake --build . - name: Run C++ tests & examples run: cmake --build . --target "RUN_TESTS_AND_EXAMPLES" - name: Build and install Python module run: | python setup.py build python setup.py install - name: Python tests run: | python test/basic-python/MeshQuad4.py # - name: Run Python examples # if: runner.os == 'Linux' # run: | # python ./docs/examples/statics/FixedDisplacements_LinearElastic/example.py --no-plot # python ./docs/examples/statics/FixedDisplacements_LinearElastic/manual_partition.py --no-plot diff --git a/environment.yaml b/environment.yaml index f49ceb8..76580cd 100644 --- a/environment.yaml +++ b/environment.yaml @@ -1,10 +1,35 @@ channels: - conda-forge dependencies: - - cmake + # dependencies - xtensor - - xsimd - eigen + + # optional dependencies + - xsimd + + # build tools + - cmake + + # Python API - python - numpy - pyxtensor + + # to run tests + - catch2 + - gmatelastic + - gmatelastoplasticqpot + + # to run examples + - h5py + - highfive + - xdmfwrite_highfive + - xdmfwrite_h5py + - gmatelastic + - gmatnonlinearelastic + - gmatelastoplastic + - gmatelastoplasticfinitestrainsimo + - gmatelastoplasticqpot + - python-gmatelastic + diff --git a/environment_examples.yaml b/environment_examples.yaml deleted file mode 100644 index a01b55d..0000000 --- a/environment_examples.yaml +++ /dev/null @@ -1,13 +0,0 @@ -channels: - - conda-forge -dependencies: - - h5py - - highfive - - xdmfwrite_highfive - - xdmfwrite_h5py - - gmatelastic - - gmatnonlinearelastic - - gmatelastoplastic - - gmatelastoplasticfinitestrainsimo - - gmatelastoplasticqpot - - python-gmatelastic diff --git a/environment_no-examples.yaml b/environment_no-examples.yaml new file mode 100644 index 0000000..b29e522 --- /dev/null +++ b/environment_no-examples.yaml @@ -0,0 +1,22 @@ +channels: + - conda-forge +dependencies: + # dependencies + - xtensor + - eigen + + # optional dependencies + - xsimd + + # build tools + - cmake + + # Python API + - python + - numpy + - pyxtensor + + # to run tests + - catch2 + - gmatelastic + - gmatelastoplasticqpot diff --git a/environment_test.yaml b/environment_test.yaml deleted file mode 100644 index c7f006f..0000000 --- a/environment_test.yaml +++ /dev/null @@ -1,6 +0,0 @@ -channels: - - conda-forge -dependencies: - - catch2 - - gmatelastic - - gmatelastoplasticqpot