update example #3560
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
changes: | |
name: Get Changes | |
runs-on: ubuntu-latest | |
outputs: | |
ui: ${{ steps.filter.outputs.ui }} | |
other: ${{ steps.filter.outputs.other }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
ui: | |
- 'ui/**' | |
other: | |
- '**' | |
- '!ui/**' | |
- '!docs/**' | |
lint: | |
name: Lint Checks | |
needs: changes | |
if: ${{ needs.changes.outputs.ui == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Npm Install | |
run: cd ui && npm ci | |
- name: UI Lint Check | |
run: cd ui && npm run lint | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
components: rustfmt | |
override: true | |
- name: Rust Format Check | |
run: | | |
cargo +nightly fmt -- --check | |
test: | |
name: Run Tests | |
needs: changes | |
if: ${{ needs.changes.outputs.other == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update APT package list | |
run: sudo apt-get update || true # skip errors as temp workaround for https://github.com/tensorlakeai/indexify/actions/runs/8814655533/job/24194983960#step:3:33 | |
- name: Install protoc | |
run: sudo apt install -y protobuf-compiler npm | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Test | |
run: ./run_tests.sh | |
- name: Clear up space | |
run: | | |
docker stop --time 90 $(docker ps -aq) || true | |
docker rm --force $(docker ps -aq) || true | |
docker rmi --force $(docker images -aq) || true |