1- name : Unit Tests unitary
1+ name : tests/ unitary/**
22
33on :
4- workflow_dispatch :
4+ push :
5+ branches :
6+ - main
7+ - ' release/**'
8+ - develop
9+ paths :
10+ - ' ads/**'
11+ - setup.py
12+ - ' **requirements.txt'
13+ - ' !docs/**'
14+
15+ pull_request :
516
617# Cancel in progress workflows on pull_requests.
718# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -12,7 +23,6 @@ concurrency:
1223permissions :
1324 contents : read
1425
15-
1626# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
1727env :
1828 SEGMENT_DOWNLOAD_TIMEOUT_MINS : 5
@@ -43,52 +53,58 @@ jobs:
4353 key : ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
4454 restore-keys : |
4555 ${{ runner.os }}-pip-
46-
4756 - uses : actions/setup-python@v4
4857 with :
4958 python-version : ${{ matrix.python-version }}
5059
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"
60+ - name : " Test config setup"
61+ shell : bash
62+ env :
63+ HOME_RUNNER_DIR : /home/runner
64+ run : |
65+ set -x # print commands that are executed
66+ mkdir -p "$HOME_RUNNER_DIR"/.oci
67+ openssl genrsa -out $HOME_RUNNER_DIR/.oci/oci_ads_user.pem 2048
68+ cat <<EOT >> "$HOME_RUNNER_DIR/.oci/config"
69+ [DEFAULT]
70+ user=ocid1.user.oc1..xxx
71+ fingerprint=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
72+ tenancy=ocid1.tenancy.oc1..xxx
73+ region=test_region
74+ key_file=$HOME_RUNNER_DIR/.oci/oci_ads_user.pem
75+ EOT
76+ ls -lha "$HOME_RUNNER_DIR"/.oci
77+ echo "Test config file:"
78+ cat $HOME_RUNNER_DIR/.oci/config
6379
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
80+ - name : " Test env setup"
81+ timeout-minutes : 20
82+ shell : bash
83+ run : |
84+ set -x # print commands that are executed
85+ sudo apt-get install libkrb5-dev graphviz
86+ $CONDA/bin/conda init
87+ source /home/runner/.bashrc
88+ pip install setuptools
89+ pip install -r dev-requirements.txt
7490
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
91+ - name : " Run unitary tests folder with maximum ADS dependencies"
92+ timeout-minutes : 60
93+ shell : bash
94+ env :
95+ NB_SESSION_COMPARTMENT_OCID : ocid1.compartment.oc1.<unique_ocid>
96+ CONDA_PREFIX : /usr/share/miniconda
97+ run : |
98+ python -m pytest -v -p no:warnings --durations=5 \
99+ ${{ matrix.test-path }} \
100+ --ignore "${{ matrix.ignore-path }}" \
101+ --cov --cov-append --cov-report=html
86102
87103# Uploading test artifacts
88104# https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
89- # - name: "Save html coverage report"
90- # uses: actions/upload-artifact@v3
91- # with:
92- # name: code-coverage-report
93- # path: htmlcov/
94- # retention-days: 10
105+ - name : " Save html coverage report"
106+ uses : actions/upload-artifact@v3
107+ with :
108+ name : code-coverage-report
109+ path : htmlcov/
110+ retention-days : 10
0 commit comments