-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (90 loc) · 2.94 KB
/
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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10.8', '3.11']
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: setup python ${{matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
cache: 'poetry'
- name: install dependence
working-directory: anomaly-detector
run: |
poetry env use ${{matrix.python-version}}
poetry install
- name: compile .pyx file
run: |
pip install Cython
pip install numpy
python setup.py build_ext --inplace
- name: run the test script
working-directory: anomaly-detector/tests
run: |
pip install pytest
poetry run pytest test_demo.py
poetry run python uvad_test.py
- name: Analyze code with pylint
run: |
pip install pylint
pylint --exit-zero $(git ls-files '*.py')
test_on_setup_whl:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10.8', '3.11']
steps:
- uses: actions/checkout@v4
- name: setup python ${{matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
cache: 'pip'
- name: gen .whl file by setup
run: |
pip install Cython numpy setuptools wheel
python setup.py sdist bdist_wheel
- name: install .whl file
run: pip install ./dist/*.whl
- name: run the test script
working-directory: anomaly-detector/tests
run: |
pip install pytest
python test_demo.py
python uvad_test.py
test_on_setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install package by setup.py
run: |
pip install Cython
pip install numpy
pip install .
- name: run the test script
working-directory: anomaly-detector/tests
run: |
pip install pytest
python test_demo.py
python uvad_test.py