Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could add timeout limit in both jobs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's useful in this case.
What do you have in mind ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid any job hanging for 6 hours,
we could add timeout-minutes: 30

https://stackoverflow.com/questions/59073731/set-default-timeout-on-github-action-pipeline

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

name: Full CI
on:
push:
branches:
- main
- dev
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pre_checks:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0

- name: Set up python
id: setup-python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "3.10"

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install deps & build base images
run: make setup

- name: Check format
run: make check_format

- name: Check linting
run: make check_linting

- name: Make sure doc is building
run: make doc

test:
runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also run in other platforms such as macos and windows, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not matter, we don't use complex lib or math lib

timeout-minutes: 30
strategy:
fail-fast: false # Do not stop when any job fails
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a TODO to remove 3.9 support after October 2025

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll remove it when we drop the support, added in a linear card

steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0

- name: Set up python
id: setup-python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
with:
python-version: "${{ matrix.python-version }}"

- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install deps & build base images
run: make setup

- name: Run the tests
run: make test
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ format: ## Format all files inside backend with black & isort

check_linting: ## Verify code with lint tools, like pylint
poetry run pylint ./src/giskard_hub
.PHONY: check_linting

check_format: ## Verify code formatting
poetry run black --check .
poetry run isort -c .
.PHONY: check_format

setup: ## Install dependencies
Expand All @@ -33,4 +38,8 @@ quick-doc: ## Build the doc & serve it locally
cp ./README.md ./script-docs/README.md
cd ./script-docs && rm -rf _build && poetry run make html
poetry run python3 -m http.server --directory ./script-docs/_build/html/
.PHONY: quick-doc
.PHONY: quick-doc

test: ## Launch unit tests
poetry run pytest -vvv ./tests
.PHONY: test
5 changes: 1 addition & 4 deletions examples/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"from giskard_hub.client import HubClient\n",
"\n",
"# Initialise hub client\n",
"hub = HubClient(\n",
" api_key=\"YOUR_API_KEY\",\n",
" hub_url=\"http://your-hub-instance.com/_api\"\n",
")\n",
"hub = HubClient(api_key=\"YOUR_API_KEY\", hub_url=\"http://your-hub-instance.com/_api\")\n",
"\n",
"# api_key and hub url can also be provided by setting env variable GSK_API_KEY and GSK_HUB_URL"
]
Expand Down
Loading