diff --git a/.ci_environment_py.yaml b/.ci_environment_py.yaml new file mode 100644 index 0000000..350d579 --- /dev/null +++ b/.ci_environment_py.yaml @@ -0,0 +1,9 @@ +channels: + - conda-forge +dependencies: + - xtensor + - eigen + - setuptools_scm + - python + - pyxtensor + - numpy diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6458bd..3bffe98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,92 +1,130 @@ name: CI on: workflow_dispatch: pull_request: push: branches: - master jobs: - default-shell: + standard: strategy: + fail-fast: false + matrix: runs-on: [ubuntu-latest, macos-latest, windows-latest] include: - runs-on: ubuntu-latest config: -DBUILD_TESTS=1 -DBUILD_EXAMPLES=1 conda: docs/examples/environment.yaml prop: tests & examples compiler: gcc gcc: 8 - runs-on: macos-latest config: -DBUILD_TESTS=1 -DBUILD_EXAMPLES=0 conda: environment.yaml prop: tests - runs-on: windows-latest config: -DBUILD_TESTS=1 -DBUILD_EXAMPLES=0 conda: environment.yaml prop: tests 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: ${{ matrix.conda }} activate-environment: test auto-activate-base: false - name: Select GCC if: matrix.gcc run: | echo "CC=gcc-${{ matrix.gcc }}" >> $GITHUB_ENV echo "CXX=g++-${{ matrix.gcc }}" >> $GITHUB_ENV - name: Configure using CMake (!Windows) if: runner.os != 'Windows' run: cmake . ${{ matrix.config }} - name: Configure using CMake (Windows) if: runner.os == 'Windows' 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++ ${{ matrix.prop }} run: cmake --build . - name: Run C++ ${{ matrix.prop }} run: ctest --output-on-failure - 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 + py: + + strategy: + + fail-fast: false + + matrix: + runs-on: [windows-latest] + include: + - runs-on: windows-latest + conda: .ci_environment_py.yaml + + defaults: + run: + shell: bash -l {0} + + name: "${{ matrix.runs-on }} • x64 ${{ matrix.args }} • py" + 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: ${{ matrix.conda }} + activate-environment: test + auto-activate-base: false + + - 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