-
Notifications
You must be signed in to change notification settings - Fork 121
174 lines (156 loc) Β· 4.97 KB
/
whylogs-ci.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: whylogs-ci
on:
pull_request:
push:
branches: [mainline, 1.0.x]
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
defaults:
run:
working-directory: python
env:
CODECOV_UPLOAD: false
POETRY_VERSION: "1.5.1"
PROTOC_VERSION: "3.19.4"
PYPI_PUBLISH: false
HEAP_APPID_DEV: "3422045963"
jobs:
python-ci:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/cache@v3
id: poetry-cache
name: Cache dependencies based on poetry.lock file
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
- name: Set up pre-commit cache
uses: actions/cache@v3
if: ${{ matrix.python-version == 3.8 && startsWith(runner.os, 'Linux')}}
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: ${{ runner.os }}-pre-commit-
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: check poetry env
run: poetry env info
- name: configure telemetry
run: make telemetry-opt-out
- name: poetry cache hit
if: steps.poetry-cache.outputs.cache-hit == 'true'
run: echo 'poetry cache hit, skipping poetry install'
- name: Install dependencies
run: make install
- name: Run pre-commit checks
if: ${{ matrix.python-version == 3.8 && startsWith(runner.os, 'Linux')}}
run: make pre-commit
- name: Run build and test
run: make test
- name: Smoke test wheel in client environment
run: |
python -m venv verify
source verify/bin/activate
pip install --upgrade pip
pip install dist/whylogs*.whl
python tests/smoketest.py
deactivate
rm -rf verify
- name: Upload test coverage report to Codecov
uses: codecov/codecov-action@v2
if: env.CODECOV_UPLOAD == 'true'
with:
fail_ci_if_error: true
flags: unit
java-ci:
runs-on: [ubuntu-latest]
defaults:
run:
shell: bash
working-directory: java
steps:
- uses: actions/checkout@v3
- name: Change to Java dir
run: |
echo $(pwd)
- name: Setup Java 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: eskatos/gradle-command-action@v1
with:
build-root-directory: java
arguments: build
- name: Smoke test jar in client environment
uses: gradle/gradle-build-action@v2
with:
build-root-directory: java/smoketest
arguments: run
gradle-executable: java/gradlew
docs-ci:
needs: python-ci
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v5
id: docs
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: echo 'cache hit ${{ steps.docs.outputs.cache-hit }}'
- uses: nikeee/setup-pandoc@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.PROTOC_VERSION }}
- name: Install dependencies for generating docs
run: poetry install --extras docs
- name: Building docs with sphinx
run: |
make proto -B
make docs
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
if: ${{ github.ref != 'refs/heads/mainline' }}
- name: Publish docs
uses: JamesIves/github-pages-deploy-action@4.0.0
with:
branch: gh-pages
folder: python/docs/_build/html
if: ${{ github.ref == 'refs/heads/mainline' }}