Skip to content

Commit 14fc632

Browse files
authored
Add workflow yml files to main branch (#116)
1 parent edb7bb7 commit 14fc632

File tree

2 files changed

+125
-35
lines changed

2 files changed

+125
-35
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Unit Tests unitary/default_setup/*
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+
jobs:
16+
test:
17+
name: python ${{ matrix.python-version }}, tests/unitary/default_setup
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 20
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.8", "3.9", "3.10"]
25+
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
# Caching python libraries installed with pip
30+
# https://github.com/actions/cache/blob/main/examples.md#python---pip
31+
- uses: actions/cache@v3
32+
with:
33+
path: ~/.cache/pip
34+
key: ${{ runner.os }}-pip-${{ hashFiles('**/test-requirements.txt') }}
35+
restore-keys: |
36+
${{ runner.os }}-pip-
37+
- uses: actions/setup-python@v4
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
# - name: "Test config setup"
42+
# shell: bash
43+
# env:
44+
# ADS_OCI_CONFIG_REALLIKE: ${{ secrets.ADS_OCI_CONFIG_REALLIKE }}
45+
# ADS_OCI_PRIVATE_KEY_REALLIKE: ${{ secrets.ADS_OCI_PRIVATE_KEY_REALLIKE }}
46+
# run: |
47+
# set -x # print commands that are executed
48+
# mkdir -p /home/runner/.oci
49+
# ls -lha
50+
# echo "$ADS_OCI_CONFIG_REALLIKE" > "/home/runner/.oci/config"
51+
# echo "$ADS_OCI_PRIVATE_KEY_REALLIKE" > "/home/runner/.oci/oci_ads_user.pem"
52+
# echo "key_file=/home/runner/.oci/oci_ads_user.pem" >> "/home/runner/.oci/config"
53+
54+
# - name: "Run default_setup tests folder ONLY with minimum ADS dependencies"
55+
# timeout-minutes: 15
56+
# shell: bash
57+
# env:
58+
# NB_SESSION_COMPARTMENT_OCID: ocid1.compartment.oc1.<unique_ocid>
59+
# NoDependency: True
60+
# run: |
61+
# set -x # print commands that are executed
62+
# $CONDA/bin/conda init
63+
# source /home/runner/.bashrc
64+
# pip install -r test-requirements.txt
65+
# python -m pytest -v -p no:warnings --durations=5 tests/unitary/default_setup

.github/workflows/run-unittests.yml

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
name: Unit Tests
1+
name: Unit Tests unitary
22

33
on:
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:
2112
permissions:
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+
2420
jobs:
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

Comments
 (0)