Skip to content

Commit

Permalink
chore(ci): simplify CI
Browse files Browse the repository at this point in the history
  • Loading branch information
seriousben committed Nov 21, 2024
1 parent 9c6c1fd commit a6603b8
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 132 deletions.
105 changes: 0 additions & 105 deletions .github/workflows/test.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Acceptance Tests
name: Tests

on:
push:
Expand All @@ -11,14 +11,24 @@ on:
paths:
- 'server/**'
- 'python-sdk/**'
- '.github/workflows/acceptance_tests.yaml'
- '.github/workflows/tests.yaml'

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build
lint_server:
name: Lint Indexify Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint indexify-server
run: |
cd server
make check
build_server:
name: Build Indexify Server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -29,19 +39,54 @@ jobs:
with:
cache-directories: |
server/target
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-directories: |
server/target
- name: Build indexify-server
run: |
cd server
cargo build
- name: Lint indexify-server
run: |
cd server
make check
- name: Test indexify-server
run: |
cd server
cargo test --workspace -- --test-threads 1
- name: Upload indexify-server
uses: actions/upload-artifact@v4
with:
name: indexify-server
path: server/target/debug/indexify-server

lint_python_sdk:
name: Lint Indexify Python SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: 'poetry'
- name: Install python dependencies
run: |
cd python-sdk
poetry install
- name: Lint python-sdk
run: |
cd python-sdk
make check
acceptance_tests:
name: Run Acceptance Tests
needs: build
needs: [build_server, lint_python_sdk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -60,6 +105,10 @@ jobs:
run: |
cd python-sdk
poetry install
- name: Lint python-sdk
run: |
cd python-sdk
make check
- name: Start Background Indexify Server
uses: JarvusInnovations/background-action@v1
with:
Expand Down Expand Up @@ -131,7 +180,7 @@ jobs:
last_release_acceptance_tests:
name: 'Last Release Acceptance Tests (trigger with label: ci_compat_test)'
if: contains(github.event.pull_request.labels.*.name, 'ci_compat_test')
needs: build
needs: [build_server, lint_python_sdk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: UI

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
paths:
- 'server/ui/**'
- '.github/workflows/tests_ui.yaml'

jobs:
lint:
name: Lint Checks
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
if: ${{ needs.changes.outputs.ui == 'true' }}
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Npm Install
if: ${{ needs.changes.outputs.ui == 'true' }}
run: cd server/ui && npm ci

- name: UI Lint Check
if: ${{ needs.changes.outputs.ui == 'true' }}
run: cd server/ui && npm run lint
60 changes: 41 additions & 19 deletions python-sdk/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python-sdk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ httpx-sse = "^0.4.0"
jsonpickle = "^4.0.0"

[tool.poetry.dev-dependencies]
black = "^22.3.0"
black = "^24.10.0"
pylint = "^2.4.0"
parameterized = "^0.9.0"

Expand Down
11 changes: 10 additions & 1 deletion server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,18 @@ push-container: ## Push container to docker hub
build-ui: ## Build Indexify UI
docker build -f dockerfiles/Dockerfile.ui --tag ${DOCKER_USERNAME}/indexify-ui .

fmt: ## Run rustfmt
nightly-toolchain:
rustup toolchain install nightly
rustup component add --toolchain nightly rustfmt

.PHONY: fmt
fmt: nightly-toolchain ## Run rustfmt
rustup run nightly cargo fmt

.PHONY: check
check: nightly-toolchain ## Run rustfmt check
rustup run nightly cargo fmt -- --check

halp: help

help: ## Show help message for each target
Expand Down

0 comments on commit a6603b8

Please sign in to comment.