-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
51 lines (49 loc) · 1.93 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: 'Unit tests'
description: 'Run unittest with coverage'
inputs:
python-version:
description: 'Which version of the python interpreter to use, e.g. "3.11"'
required: true
env-prefix:
description: 'Prefix to the path to the environment'
required: true
env-label:
description: 'A label for the environment'
required: true
env-files:
description: 'Paths to an arbitrary number of (space-separated) conda environment yaml files'
default: .ci_support/environment.yml
required: false
standard-unittests-env-file:
description: 'Env files this action thinks are useful (adds jupyter and papermill packages)'
default: $GITHUB_ACTION_PATH/../.support/environment-unittests.yml
required: false
coveralls-codacy-env-file:
description: 'An extra env file since we usually combine this action with coverage+unittest, and called workflows cannot access their own repo'
default: $GITHUB_ACTION_PATH/../.support/environment-coveralls-codacy.yml
required: false
test-dir:
description: 'The directory containing the tests'
default: tests
required: false
source-dir:
description: 'The directory(ies) to pass as sources to coverage (default is repository name, i.e. in my_repo/my_repo'
required: false
# omitted-files:
# description: 'File(s) to omit when finding coverage'
# required: false
# TODO: Allow omission of additional files with a bash for-loop over source-dir and omitted-files
runs:
using: 'composite'
steps:
- uses: pyiron/actions/cached-mamba@main
with:
python-version: ${{ inputs.python-version }}
env-prefix: ${{ inputs.env-prefix }}
env-label: ${{ inputs.env-label }}
env-files: ${{ inputs.standard-unittests-env-file }} ${{ inputs.coveralls-codacy-env-file }} ${{ inputs.env-files }}
- uses: pyiron/actions/pyiron-config@main
- name: Test
shell: bash -l {0}
run: |
coverage run -m unittest discover ${{ inputs.test-dir }}