2022-12-15 09:03:56 -07:00
|
|
|
name: Server Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-03-03 07:07:27 -07:00
|
|
|
- ".github/workflows/tests.yaml"
|
2022-12-15 09:03:56 -07:00
|
|
|
- "server/**"
|
|
|
|
- "proto/**"
|
2022-12-16 03:29:36 -07:00
|
|
|
- "router/**"
|
|
|
|
- "launcher/**"
|
2023-03-23 11:01:30 -06:00
|
|
|
- "Cargo.lock"
|
|
|
|
- "rust-toolchain.toml"
|
2022-12-15 09:03:56 -07:00
|
|
|
|
2023-03-24 07:02:14 -06:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-12-15 09:03:56 -07:00
|
|
|
jobs:
|
|
|
|
run_tests:
|
2024-09-11 14:41:56 -06:00
|
|
|
runs-on:
|
|
|
|
group: aws-highmemory-32-plus-priv
|
2022-12-15 09:03:56 -07:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
2024-09-11 14:41:56 -06:00
|
|
|
uses: actions/setup-python@v4
|
|
|
|
id: python
|
2022-12-15 09:03:56 -07:00
|
|
|
with:
|
2024-09-11 14:41:56 -06:00
|
|
|
python-version: 3.11
|
2022-12-16 03:29:36 -07:00
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2024-06-24 10:08:34 -06:00
|
|
|
# Released on: 02 May, 2024
|
|
|
|
# https://releases.rs/docs/1.78.0/
|
2024-08-29 08:29:01 -06:00
|
|
|
toolchain: 1.80.0
|
2022-12-16 03:29:36 -07:00
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2023-02-13 05:02:45 -07:00
|
|
|
- name: Install Protoc
|
|
|
|
uses: arduino/setup-protoc@v1
|
2024-02-21 03:05:32 -07:00
|
|
|
- name: Clean unused files
|
|
|
|
run: |
|
|
|
|
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
|
|
|
|
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
|
2022-12-16 03:29:36 -07:00
|
|
|
- name: Install
|
2022-12-15 09:03:56 -07:00
|
|
|
run: |
|
2024-09-19 12:50:37 -06:00
|
|
|
sudo apt update
|
2024-09-11 14:41:56 -06:00
|
|
|
sudo apt install python3.11-dev -y
|
2024-06-04 11:38:46 -06:00
|
|
|
make install-cpu
|
2022-12-16 03:29:36 -07:00
|
|
|
- name: Run server tests
|
2022-12-15 09:03:56 -07:00
|
|
|
run: |
|
|
|
|
pip install pytest
|
2024-06-25 05:20:57 -06:00
|
|
|
export HF_TOKEN=${{ secrets.HF_TOKEN }}
|
2023-05-16 15:23:27 -06:00
|
|
|
pytest -s -vv server/tests
|
2024-02-16 03:58:58 -07:00
|
|
|
- name: Pre-commit checks
|
2023-04-26 12:23:54 -06:00
|
|
|
run: |
|
2024-02-16 03:58:58 -07:00
|
|
|
pip install pre-commit
|
|
|
|
pre-commit install
|
|
|
|
pre-commit run --all-files
|
2022-12-16 03:29:36 -07:00
|
|
|
- name: Run Rust tests
|
|
|
|
run: |
|
|
|
|
cargo test
|
2024-09-26 03:41:38 -06:00
|
|
|
- name: Run Rust tests with google feature
|
|
|
|
run: |
|
|
|
|
cargo test --features google
|