|
| 1 | +name: Unit Tests unitary |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +# Cancel in progress workflows on pull_requests. |
| 7 | +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | + |
| 16 | +# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359 |
| 17 | +env: |
| 18 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 |
| 19 | + |
| 20 | +jobs: |
| 21 | + test: |
| 22 | + name: python ${{ matrix.python-version }}, ${{ matrix.test-path }}, ignore ${{ matrix.ignore-path }} |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 90 |
| 25 | + |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 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" |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v3 |
| 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 | +
|
| 47 | + - uses: actions/setup-python@v4 |
| 48 | + with: |
| 49 | + python-version: ${{ matrix.python-version }} |
| 50 | + |
| 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 |
| 74 | + |
| 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 |
| 86 | + |
| 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" |
| 90 | +# uses: actions/upload-artifact@v3 |
| 91 | +# with: |
| 92 | +# name: code-coverage-report |
| 93 | +# path: htmlcov/ |
| 94 | +# retention-days: 10 |
0 commit comments