1- name : Unit Tests
1+ name : Unit Tests unitary
22
33on :
44 workflow_dispatch :
5- push :
6- branches :
7- - main
8- - ' release/**'
9- - develop
10- paths :
11- - ' !docs/**'
12-
13- pull_request :
145
156# Cancel in progress workflows on pull_requests.
167# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -21,47 +12,81 @@ concurrency:
2112permissions :
2213 contents : read
2314
15+
16+ # hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
17+ env :
18+ SEGMENT_DOWNLOAD_TIMEOUT_MINS : 5
19+
2420jobs :
2521 test :
26- name : ${{ matrix.tests-type }}, python ${{ matrix.python-version }}
22+ name : python ${{ matrix.python-version }}, ${{ matrix.test-path }}, ignore ${{ matrix.ignore-path }}
2723 runs-on : ubuntu-latest
28- timeout-minutes : 45
24+ timeout-minutes : 90
2925
3026 strategy :
3127 fail-fast : false
3228 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"
3534
3635 steps :
3736 - 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+
4447 - uses : actions/setup-python@v4
4548 with :
4649 python-version : ${{ matrix.python-version }}
4750
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
5174
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
6186
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 "
6590# uses: actions/upload-artifact@v3
6691# with:
6792# name: code-coverage-report
0 commit comments