-
Notifications
You must be signed in to change notification settings - Fork 11
48 lines (45 loc) · 1.42 KB
/
test.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
name: Run Tests
on:
push:
branches: [ "main", "ci-testing" ]
permissions:
contents: read
jobs:
test-all-extras:
name: Test with all extra dependencies
# (expected to include all tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the latest version of rye
uses: eifinger/setup-rye@v3
- name: Install dependencies
run: rye sync
- name: Run tests
run: rye test
test-examples:
name: Test invariant.examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the latest version of rye
uses: eifinger/setup-rye@v3
- name: Install dependencies
run: rye sync # requires all extras
- name: Run invariant.examples
env:
OPENAI_API_KEY: ${{ secrets.CI_OPENAI_API_KEY }}
run: rye run python -m unittest discover -s invariant/examples -p "*_example.py"
test-no-extras:
name: Test without extra dependencies
# (some tests will be skipped, but this is the default setup when users install the package)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install the latest version of rye
uses: eifinger/setup-rye@v3
- name: Install dependencies
run: rye sync --no-dev
- name: Run tests
# use 'unittest' explicitly, to prevent rye from install dev dependencies (no extras run)
run: rye run python -m unittest discover tests