forked from sandialabs/SetProgramOptions
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (102 loc) · 3.26 KB
/
test-driver-core.yml
File metadata and controls
120 lines (102 loc) · 3.26 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: SetProgramOptions Testing
on:
push:
pull_request:
schedule:
- cron: '0 13,1 * * *'
defaults:
run:
shell: bash
env:
cache-name: venv-cache
venv-name: venv-python
jobs:
install_requirements:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Cache
uses: actions/cache@v2
with:
path: ${{ env.venv-name }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Checkout
uses: actions/checkout@v2
with:
path: source
- name: Build VirtualEnv
run: |
# cd ${{ github.workspace }}
echo "cache name : '${{ env.cache-name }}'"
echo "github.head_ref : '${{ github.head_ref }}'"
echo "github.sha : '${{ github.sha }}'"
#pwd
#ls -ltrhF
python3 --version > version.txt
cat version.txt
python3 -m venv ${{ env.venv-name }}
#ls -ltrhF ${{ env.venv-name }}/bin/
source ${{ env.venv-name }}/bin/activate
echo "VIRTUAL_ENV = ${VIRTUAL_ENV}"
cd source
python3 -m pip install wheel -r requirements.txt -r requirements-test.txt -r doc/requirements.txt
#ls -ltrhF
pytest:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [install_requirements]
steps:
- name: Cache
uses: actions/cache@v2
with:
path: ${{ env.venv-name }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Checkout
uses: actions/checkout@v2
with:
path: source
- name: Execute Unit Tests
run: |
source ${{ env.venv-name }}/bin/activate
echo "VIRTUAL_ENV = ${VIRTUAL_ENV}"
cd source
python3 -m pytest --version
python3 -m pytest --cov=setprogramoptions --cov-report=term --cov-report=html:${{ github.workspace }}/htmlcov --cov-config=.coveragerc
ls -ltrhF ${{ github.workspace }}/htmlcov
- name: Test Installation
run: |
source ${{ env.venv-name }}/bin/activate
echo "VIRTUAL_ENV = ${VIRTUAL_ENV}"
cd source
python3 -m pip install .
- name: Test Examples
run: |
source ${{ env.venv-name }}/bin/activate
echo "VIRTUAL_ENV = ${VIRTUAL_ENV}"
cd source/examples
python3 ./example-01.py
python3 ./example-02.py
python3 ./example-03.py
- name: Test Uninstaller
run: |
source ${{ env.venv-name }}/bin/activate
echo "VIRTUAL_ENV = ${VIRTUAL_ENV}"
cd source
python3 -m pip uninstall -y setprogramoptions
- name: Save Coverage Artifacts
uses: actions/upload-artifact@v2
with:
name: coverage
path: htmlcov
retention-days: 5
# - name: Cache
# uses: actions/cache@v2
# env:
# cache-name: cache-venv
# with:
# key: v1-deps-${{ hashFiles('**/package-lock.json') }}
# restore-keys: v1-deps-