forked from Cornerstone-OnDemand/modelkit
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.59 KB
/
main.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
name: CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
name: ${{ fromJson('{"macos-latest":"macOS","windows-latest":"Windows","ubuntu-latest":"Ubuntu"}')[matrix.os] }} ${{ matrix.python-version }} ${{ matrix.nox-session}}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Up Python - ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: python -m pip install --upgrade nox
- name: Run Tests
run: scripts/ci_tests.sh
env:
OS_NAME: "${{ matrix.os }}"
PYTHON_VERSION: "${{ matrix.python-version }}"
- name: Add & Commit Badges
if: ${{matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' && github.ref == 'refs/heads/main'}}
run: |
git config user.name github-actions
git config user.email [email protected]
git add docs/badges
git diff-index --quiet HEAD || git commit -m "generate badges"
git push
- name: 'Upload coverage report'
if: ${{matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' && github.ref == 'refs/heads/main'}}
uses: actions/upload-artifact@v3
with:
name: coverage
path: docs/coverage
retention-days: 1