Skip to content

Commit 3de3436

Browse files
committed
add ci workflow
Signed-off-by: kerthcet <kerthcet@gmail.com>
1 parent 0eadeca commit 3de3436

22 files changed

Lines changed: 99 additions & 29 deletions

File tree

.github/workflows/ci-test.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI Test
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
test-python:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
21+
- name: Install uv
22+
run: pip install uv
23+
24+
- name: Install dependencies
25+
run: source start.sh
26+
27+
- name: cd into backend directory
28+
run: cd bindings/python
29+
30+
- name: Run tests
31+
run: make test
32+
33+
- name: Install docker-compose
34+
run: |
35+
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
36+
sudo chmod +x /usr/local/bin/docker-compose
37+
docker-compose --version
38+
39+
- name: Run integration tests
40+
run: |
41+
make test-integration
42+
43+
test-rust:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Rust
49+
uses: actions-rs/toolchain@v1
50+
with:
51+
toolchain: stable
52+
override: true
53+
54+
- name: Run tests
55+
run: make test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ dist/
1818
# Added by cargo
1919

2020
/target
21+
.ruff_cache/
22+
.venv/

Makefile

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,9 @@
1-
POETRY := poetry
2-
RUFF := .venv/bin/ruff
3-
PYTEST := .venv/bin/pytest
4-
5-
.PHONY: build
6-
build: lint
7-
$(POETRY) build
8-
9-
.PHONY: publish
10-
publish: build
11-
$(POETRY) publish --username=__token__ --password=$(INFTYAI_PYPI_TOKEN)
12-
13-
.PHONY: lint
14-
lint:
15-
$(RUFF) check .
1+
CARGO := cargo
162

173
.PHONY: format
184
format:
19-
$(RUFF) format .
20-
$(RUFF) check --fix .
5+
$(CARGO) fmt
216

227
.PHONY: test
23-
test: lint
24-
$(PYTEST) tests/unit --timeout=15
25-
26-
.PHONY: test-integration
27-
test-integration: lint
28-
$(PYTEST) tests/integration --timeout=30
29-
'
30-
.PHONY: test-all
31-
test-all: test test-integration
8+
test: format
9+
$(CARGO) test

bindings/python/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
POETRY := poetry
2+
RUFF := .venv/bin/ruff
3+
PYTEST := .venv/bin/pytest
4+
5+
.PHONY: build
6+
build: lint
7+
$(POETRY) build
8+
9+
.PHONY: publish
10+
publish: build
11+
$(POETRY) publish --username=__token__ --password=$(INFTYAI_PYPI_TOKEN)
12+
13+
.PHONY: lint
14+
lint:
15+
$(RUFF) check .
16+
17+
.PHONY: format
18+
format:
19+
$(RUFF) format .
20+
$(RUFF) check --fix .
21+
22+
.PHONY: test
23+
test: lint
24+
$(PYTEST) tests/unit --timeout=15
25+
26+
.PHONY: test-integration
27+
test-integration: lint
28+
$(PYTEST) tests/integration --timeout=30
29+
30+
.PHONY: test-all
31+
test-all: test test-integration

bindings/python/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Python Binding for AMRS

0 commit comments

Comments
 (0)