-
Notifications
You must be signed in to change notification settings - Fork 7
104 lines (85 loc) · 3.68 KB
/
integration_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
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
name: Integration tests
on:
pull_request_review:
branches: [ main ]
types: [submitted]
workflow_dispatch:
jobs:
model-pack-tests:
if: github.event.review.state == 'approved' || github.event_name == 'workflow_dispatch'
runs-on: [ubuntu-latest]
strategy:
fail-fast: false
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: pip
- name: create venv and install dependencies
run: |
rm -r /tmp/kazu-env || true
PIP_CACHE_DIR=$(pip cache dir)
echo "pip cache dir is "${PIP_CACHE_DIR}
python -m venv /tmp/kazu-env
. /tmp/kazu-env/bin/activate
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager --index-url https://download.pytorch.org/whl/cpu "torch>=2.0.0"
pip install -e ."[dev]" --cache-dir $PIP_CACHE_DIR --upgrade --upgrade-strategy eager
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
# TODO: network issue on gradle DL
# - name: Setup and execute Gradle 'test' task
# uses: gradle/gradle-build-action@v2
# with:
# arguments: test
# build-root-directory: kazu-jvm/
- name: Build model pack caches and test
id: model_pack_cache_build
run: |
export BASE_KAZU_CONF_PATH=$GITHUB_WORKSPACE"/kazu/conf"
# set PYTHONUNBUFFERED so that we see failures in logs before freeze
export PYTHONUNBUFFERED=1
# random suffix to prevent clashes with other runs
export MODEL_PACK_BUILD_PATH=$GITHUB_WORKSPACE"/temp_model_pack_test_dir_"$RANDOM
export KAZU_LOGGING_CONF=$GITHUB_WORKSPACE"/kazu/utils/model_pack_build_logging.conf"
export KAZU_MODEL_PACK_BUILD_RESOURCES_PATH=$GITHUB_WORKSPACE"/resources/"
mkdir $MODEL_PACK_BUILD_PATH
. /tmp/kazu-env/bin/activate
python -m kazu.utils.build_and_test_model_packs \
--base_configuration_path $BASE_KAZU_CONF_PATH \
--model_packs_to_build kazu_model_pack_public \
--model_pack_output_path $MODEL_PACK_BUILD_PATH \
--skip_tests \
--logging_config_path $KAZU_LOGGING_CONF \
--debug
export KAZU_MODEL_PACK=$(echo $MODEL_PACK_BUILD_PATH/kazu_model_pack_public)
# skip server tests on runner due to low shared memory.
export SKIP_KAZU_SERVER_TESTS=1
# skip experimental modules
export SKIP_KAZU_EXPERIMENTAL_TESTS=1
# separate out hypothesis and non-hypothesis tests
# because the hypothesis cache causes memory to grow significantly and
# cause the run to fail.
pytest -m "not hypothesis"
pytest -m "hypothesis"
# build sphinx html and run doctests
# this needs to be after the model pack build because they depend on the
# model pack being present for doctests that load the full pipeline.
# We've already built the html docs in the pre-commit and docs
# check, but doctest can only be done here. It seems worth it to double
# check and build the html target while sphinx is running, just in case
# it interacts weirdly with the model pack build somehow.
make -C docs html doctest
# need to call twice, for NFS bug
rm -r /tmp/kazu-env || true
rm -r /tmp/kazu-env || true
rm -r $MODEL_PACK_BUILD_PATH || true
rm -r $MODEL_PACK_BUILD_PATH || true