diff --git a/.github/workflows/test-fice.yml b/.github/workflows/test-fice.yml index 3f3179b..e8a2aaf 100644 --- a/.github/workflows/test-fice.yml +++ b/.github/workflows/test-fice.yml @@ -1,4 +1,4 @@ -name: test-fice +name: test-fenics_ice on: push: @@ -8,73 +8,35 @@ on: branches: - main -jobs: - - fice-install: - name: Install fenics_ice - runs-on: ubuntu-latest +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + test: + runs-on: ubuntu-22.04 + timeout-minutes: 60 + env: + OMP_NUM_THREADS: 1 + OPENBLAS_NUM_THREADS: 1 steps: - - # Get fice code - - uses: actions/checkout@v2 + - name: Checkout fenics_ice + uses: actions/checkout@v4 with: path: 'fenics_ice' - - # Get tlm-adjoint code - - uses: actions/checkout@v2 + - name: Checkout tlm_adjoint + uses: actions/checkout@v4 with: repository: 'tlm-adjoint/tlm_adjoint' path: 'tlm_adjoint' - - # Get micromamba & prerequisites - - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v2 - env: - # Increase this value to reset cache if environment.yml has not changed - CACHE_NUMBER: 0 - with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: anaconda-client-env - use-mamba: true - - - name: Install mamba environment from fenics_ice/environment.yml - # if: steps.cache-conda.outputs.cache-hit != 'true' - uses: mamba-org/provision-with-micromamba@main - with: - environment-name: fenics_ice - environment-file: fenics_ice/environment.yml - channel-priority: strict - #auto-update-conda: true - #use-only-tar-bz2: true # necessary for caching - - # Get conda info - - name: mamba info - shell: bash -l {0} + - name: Install dependencies run: | - micromamba info - micromamba list - which python - python -m pip install scipy==1.9.3 - - # We install fenics_ice and tlm_adjoint as developing modules - - name: Install repositories as dev modules - shell: bash -l {0} - run: | - ls $GITHUB_WORKSPACE - cd $GITHUB_WORKSPACE/fenics_ice - pip install -e . - cd $GITHUB_WORKSPACE/tlm_adjoint - pip install -e . - micromamba info - - # Test fenics ice! - - name: Test fice - shell: bash -l {0} + sudo apt-get update + sudo apt-get install python3-dolfin python3-git python3-h5py python3-matplotlib python3-pytest-dependency python3-pytest-order python3-netcdf4 python3-numpy python3-pytest python3-pytest-timeout python3-scipy python3-sympy + - name: Run tests run: | - cd $GITHUB_WORKSPACE/fenics_ice/ - which python - pytest -v --order-scope=module --color=yes - mpirun -n 2 pytest -v --order-scope=module --color=yes - mpirun -n 2 pytest -m key --key=smith --color=yes + export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/tlm_adjoint + cd fenics_ice + pytest-3 -v --order-scope=module --timeout=300 --timeout-method=thread + mpirun -n 2 pytest-3 -v --order-scope=module --timeout=300 --timeout-method=thread + mpirun -n 2 pytest-3 -m key --key=smith --timeout=300 --timeout-method=thread