added tests workflow #2
Workflow file for this run
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: PR Tests Workflow | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# -------------------- Frontend Tests -------------------- | |
frontend-tests: | |
name: Frontend Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Dependencies & Run Tests | |
run: | | |
cd frontend | |
npm install | |
npm test | |
# -------------------- Backend Tests -------------------- | |
backend-tests: | |
name: Backend Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Dependencies & Run Tests | |
run: | | |
cd backend | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pyinstaller main.py --name PictoPy_Server --onedir --distpath dist | |
pytest | |
# -------------------- Tauri (Rust) Tests -------------------- | |
tauri-tests: | |
name: Tauri Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run Tauri Tests | |
run: | | |
cd frontend/src-tauri | |
cargo test |