-
Notifications
You must be signed in to change notification settings - Fork 826
58 lines (53 loc) · 2.04 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support documentation.
# This workflow will do a clean install of python dependencies, build the source code and run tests across different versions of python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build and Test
on:
push:
branches: [ '**' ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_test:
name: Build on Python ${{ matrix.python-version }} using ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
pip3 install --editable .
- name: Execute Python 3.11 unit tests
if: matrix.python-version == '3.11'
run: |
pip3 install -U python-dotenv
py.test test/unit
- name: Execute Python 3.12 unit tests (ubuntu)
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
run: |
pip3 install -U python-dotenv
py.test test/unit --reruns 3 --cov=ibm_watson
- name: Execute Python 3.13 unit tests (ubuntu)
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
run: |
pip3 install -U python-dotenv
py.test test/unit --reruns 3
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v1
with:
name: py${{ matrix.python-version }}-${{ matrix.os }}