41 lines
867 B
YAML
41 lines
867 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test-and-package:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Install dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Run tests
|
|
run: python -m pytest tests/ -v
|
|
|
|
- name: Package artifact
|
|
run: |
|
|
zip -r meal-tracker.zip . \
|
|
-x ".git/*" \
|
|
-x ".gitea/*" \
|
|
-x ".env" \
|
|
-x "docker-compose.yml" \
|
|
-x ".pytest_cache/*" \
|
|
-x "__pycache__/*" \
|
|
-x "meals.db"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: meal-tracker
|
|
path: meal-tracker.zip
|