Skip to content

tests

tests #412

Workflow file for this run

name: tests
on:
push:
branches-ignore:
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Runs the workflow once per day at 3:15am
schedule:
- cron: '3 16 * * *'
env:
CACHE_NUMBER: 1 # increase to reset cache manually
jobs:
tests:
runs-on: ubuntu-latest
#outputs:
# branch_coverage: ${{ steps.pytest.outputs.coverage }}
# coverage_report: ${{ steps.pytest.outputs.report }}
steps:
- name: checkout repo content
uses: actions/checkout@v2
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: fenics-constitutive
use-mamba: true
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
#- uses: actions/cache@v2
# with:
# path: "/usr/share/miniconda3/envs/fenics-constitutive"
# key: conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
# id: cache
- name: Update environment
run: mamba env update -n fenics-constitutive -f environment.yml
#if: steps.cache.outputs.cache-hit != 'true'
- name: pytest
id : pytest
shell: bash -l {0}
run: |
pytest
#- name: execute example scripts
# shell: bash -l {0}
# run: |
# for file in docs/examples/*.py
# do
# python $file
# done