-
Notifications
You must be signed in to change notification settings - Fork 121
186 lines (164 loc) Β· 5.42 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
175
176
177
178
179
180
181
182
183
184
185
186
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.7.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, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Set up python with poetry cache
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- run: echo 'python ${{ matrix.python-version }} poetry cache hit ${{ steps.setup-python.outputs.cache-hit }}'
- name: Set up pre-commit cache
uses: actions/cache@v3
if: 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@v1
with:
version: ${{ env.PROTOC_VERSION }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Poetry version
run: |
POETRY_VERSION_INSTALLED=$(poetry -V)
echo "The POETRY_VERSION environment variable is set to $POETRY_VERSION."
echo "The installed Poetry version is $POETRY_VERSION_INSTALLED."
case $POETRY_VERSION_INSTALLED in
*$POETRY_VERSION*) echo "Poetry version correct." ;;
*) echo "Poetry version incorrect." && exit 1 ;;
esac
- name: Install dependencies
run: make telemetry-opt-out install
- name: Check virtualenv location
run: |
EXPECTED_VIRTUALENV_PATH=${{ github.workspace }}/python/.venv
INSTALLED_VIRTUALENV_PATH=$(poetry env info --path)
echo "The virtualenv should be at $EXPECTED_VIRTUALENV_PATH."
echo "Poetry is using a virtualenv at $INSTALLED_VIRTUALENV_PATH."
case "$INSTALLED_VIRTUALENV_PATH" in
"$EXPECTED_VIRTUALENV_PATH") echo "Correct Poetry virtualenv." ;;
*) echo "Incorrect Poetry virtualenv." && exit 1 ;;
esac
- name: Run pre-commit checks
if: ${{ matrix.python-version == 3.8 }}
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@v3
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v4
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/[email protected]
with:
branch: gh-pages
folder: python/docs/_build/html
if: ${{ github.ref == 'refs/heads/mainline' }}