added tests workflow #5
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: CI for PictoPy | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# Frontend Test Job | |
frontend: | |
runs-on: ubuntu-latest | |
name: Frontend Tests | |
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 Test Job | |
backend: | |
runs-on: ubuntu-latest | |
name: Backend Tests | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Python 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 Test Job | |
tauri: | |
runs-on: ubuntu-latest | |
name: Tauri Tests | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install Dependencies for Tauri | |
run: | | |
sudo apt-get update -y | |
echo "deb http://gb.archive.ubuntu.com/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/gb-ubuntu.list | |
sudo apt-get install -y \ | |
curl build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev \ | |
wget xz-utils libssl-dev libglib2.0-dev libgirepository1.0-dev pkg-config \ | |
software-properties-common libjavascriptcoregtk-4.0-dev libjavascriptcoregtk-4.1-dev \ | |
libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev file libglib2.0-dev libgl1-mesa-glx | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install Frontend Dependencies | |
run: | | |
cd frontend | |
npm install | |
- name: Build Backend for Tauri | |
run: | | |
cd backend | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pyinstaller main.py --name PictoPy_Server --onedir --distpath dist | |
- name: Run Tauri Tests | |
run: | | |
cd frontend/src-tauri | |
cargo test |