generated from frehburg/TemplateForPythonProjects
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.35 KB
/
cli_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: RareLink CLI
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
test-cli:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout Repository
uses: actions/checkout@v3
# Step 2: Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
# Step 3: Install dependencies
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --editable .[test]
# Step 4: Run pytest for CLI tests
- name: Run CLI Tests
run: |
mkdir -p rarelink/tests/cli # Ensure the directory exists
if pytest rarelink/tests/cli; then
echo '{"schemaVersion": 1, "label": "RareLink CLI", "message": "passing", "color": "blue"}' > rarelink/tests/cli/status.json
else
echo '{"schemaVersion": 1, "label": "RareLink CLI", "message": "failing", "color": "red"}' > rarelink/tests/cli/status.json
fi
# Step 5: Upload status.json as an artifact (optional for debugging)
- name: Upload status.json
uses: actions/upload-artifact@v3
with:
name: cli-status
path: rarelink/tests/cli/status.json