1
- name : Unit Tests
1
+ name : Unit Tests unitary
2
2
3
3
on :
4
4
workflow_dispatch :
5
- push :
6
- branches :
7
- - main
8
- - ' release/**'
9
- - develop
10
- paths :
11
- - ' !docs/**'
12
-
13
- pull_request :
14
5
15
6
# Cancel in progress workflows on pull_requests.
16
7
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -21,47 +12,81 @@ concurrency:
21
12
permissions :
22
13
contents : read
23
14
15
+
16
+ # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
17
+ env :
18
+ SEGMENT_DOWNLOAD_TIMEOUT_MINS : 5
19
+
24
20
jobs :
25
21
test :
26
- name : ${{ matrix.tests-type }}, python ${{ matrix.python-version }}
22
+ name : python ${{ matrix.python-version }}, ${{ matrix.test-path }}, ignore ${{ matrix.ignore-path }}
27
23
runs-on : ubuntu-latest
28
- timeout-minutes : 45
24
+ timeout-minutes : 90
29
25
30
26
strategy :
31
27
fail-fast : false
32
28
matrix :
33
- python-version : ["3.7","3.8","3.9","3.10"]
34
- tests-type : ["DefaultSetup"]
29
+ python-version : ["3.8", "3.9", "3.10"]
30
+ test-path : ["tests/unitary", "tests/unitary/with_extras/model"]
31
+ include :
32
+ - test-path : " tests/unitary"
33
+ ignore-path : " tests/unitary/with_extras/model"
35
34
36
35
steps :
37
36
- uses : actions/checkout@v3
38
- # - uses: actions/cache@v3
39
- # with:
40
- # path: ~/.cache/pip
41
- # key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }}
42
- # restore-keys: |
43
- # ${{ runner.os }}-pip-
37
+
38
+ # Caching python libraries installed with pip
39
+ # https://github.com/actions/cache/blob/main/examples.md#python---pip
40
+ - uses : actions/cache@v3
41
+ with :
42
+ path : ~/.cache/pip
43
+ key : ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
44
+ restore-keys : |
45
+ ${{ runner.os }}-pip-
46
+
44
47
- uses : actions/setup-python@v4
45
48
with :
46
49
python-version : ${{ matrix.python-version }}
47
50
48
- - name : " Setup test env"
49
- run : |
50
- pip install coverage pytest-codecov tox==4.2.8
51
+ # - name: "Test config setup"
52
+ # shell: bash
53
+ # env:
54
+ # ADS_OCI_CONFIG_REALLIKE: ${{ secrets.ADS_OCI_CONFIG_REALLIKE }}
55
+ # ADS_OCI_PRIVATE_KEY_REALLIKE: ${{ secrets.ADS_OCI_PRIVATE_KEY_REALLIKE }}
56
+ # run: |
57
+ # set -x # print commands that are executed
58
+ # mkdir -p /home/runner/.oci
59
+ # ls -lha
60
+ # echo "$ADS_OCI_CONFIG_REALLIKE" > "/home/runner/.oci/config"
61
+ # echo "$ADS_OCI_PRIVATE_KEY_REALLIKE" > "/home/runner/.oci/oci_ads_user.pem"
62
+ # echo "key_file=/home/runner/.oci/oci_ads_user.pem" >> "/home/runner/.oci/config"
63
+
64
+ # - name: "Test env setup"
65
+ # timeout-minutes: 20
66
+ # shell: bash
67
+ # run: |
68
+ # set -x # print commands that are executed
69
+ # sudo apt-get install libkrb5-dev graphviz
70
+ # $CONDA/bin/conda init
71
+ # source /home/runner/.bashrc
72
+ # pip install setuptools
73
+ # pip install -r dev-requirements.txt
51
74
52
- - name : " Run unit tests"
53
- timeout-minutes : 45
54
- shell : bash
55
- run : |
56
- set -x # print commands that are executed
57
- # coverage erase
58
- # ./scripts/runtox.sh "${{ matrix.python-version }}-${{ matrix.tests-type }}" --cov --cov-report=
59
- # coverage combine .coverage-*
60
- # coverage html -i
75
+ # - name: "Run unitary tests folder with maximum ADS dependencies"
76
+ # timeout-minutes: 60
77
+ # shell: bash
78
+ # env:
79
+ # NB_SESSION_COMPARTMENT_OCID: ocid1.compartment.oc1.<unique_ocid>
80
+ # CONDA_PREFIX: /usr/share/miniconda
81
+ # run: |
82
+ # python -m pytest -v -p no:warnings --durations=5 \
83
+ # ${{ matrix.test-path }} \
84
+ # --ignore "${{ matrix.ignore-path }}" \
85
+ # --cov --cov-append --cov-report=html
61
86
62
- # Uploading test artifacts
63
- # https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
64
- # - name: "Upload artifact "
87
+ # Uploading test artifacts
88
+ # https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
89
+ # - name: "Save html coverage report "
65
90
# uses: actions/upload-artifact@v3
66
91
# with:
67
92
# name: code-coverage-report
0 commit comments