-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.52 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
49
name: Test
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
python-version: ["3.10"]
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v03
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[testing]
- name: Check for OPENAI_API_KEY
run: |
if [ -z "${{ secrets.OPENAI_API_KEY }}" ]; then
echo "Warning: OPENAI_API_KEY is not set in GitHub secrets."
echo "Please set the OPENAI_API_KEY secret in your repository settings."
echo "Follow the instructions here:"
echo "https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository"
# exit 1
fi
- name: Run tests
run: pytest
env:
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}