forked from FEniCS/ufl
-
Notifications
You must be signed in to change notification settings - Fork 11
73 lines (64 loc) · 1.99 KB
/
test.yml
File metadata and controls
73 lines (64 loc) · 1.99 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This workflow will install Python dependencies and run tests
name: UFL CI
on:
workflow_call:
inputs:
python-version:
description: "Python version"
default: "3.12"
type: string
os:
description: "Operating system"
default: "ubuntu-latest"
type: string
deploy:
description: "Upload to coveralls"
default: false
type: boolean
workflow_dispatch:
inputs:
python-version:
description: "Python version"
default: "3.12"
type: string
os:
description: "Operating system"
default: "ubuntu-latest"
type: string
deploy:
description: "Upload to coveralls"
default: false
type: boolean
jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.sha }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
- name: Install UFL
run: python -m pip install .[ci]
- name: Run unit tests
# Run tests twice, coverage raises warnings, thus does not pass with -W error
run: |
python -m pytest -W error -n auto test/
python -m pytest -n auto --cov=ufl/ --junitxml=junit/test-results-${{ inputs.os }}-${{ inputs.python-version }}.xml test/
- name: Upload documentation artifact
uses: actions/upload-artifact@v6
with:
name: test-results-${{ inputs.os }}-${{ inputs.python-version }}
path: junit/test-results-${{ inputs.os }}-${{ inputs.python-version }}.xml
retention-days: 2
if-no-files-found: error
- name: Install coveralls
run: pip install coveralls
- name: Upload to Coveralls
if: ${{ inputs.deploy }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls