Skip to content

Commit

Permalink
update python version & add tests for different python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
juaduan committed Jan 18, 2024
1 parent 0352428 commit 7ac7899
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 695 deletions.
29 changes: 8 additions & 21 deletions .github/workflows/tests.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
branches: [ "main", "dev"]
pull_request:
branches: [ "main" ]
branches: [ "main", "dev" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -19,6 +19,9 @@ jobs:
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10.8', '3.11', '3.12']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -28,12 +31,6 @@ jobs:
- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'poetry'

- name: install dependence
working-directory: anomaly-detector
run: poetry install
Expand All @@ -49,17 +46,15 @@ jobs:
test_on_poetry_whl:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10.8', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: gen .whl file by poetry
working-directory: anomaly-detector
run: poetry build
Expand All @@ -79,13 +74,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: setup.py

- name: install package by setup.py
run: pip install .

Expand All @@ -94,4 +82,3 @@ jobs:
run: |
pip install pytest
python test_demo.py
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,7 @@ FodyWeavers.xsd

mlruns/
mlartifacts/
model/
model/
venv/

.idea/
Loading

0 comments on commit 7ac7899

Please sign in to comment.