-
Notifications
You must be signed in to change notification settings - Fork 22
60 lines (53 loc) · 1.81 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
50
51
52
53
54
55
56
57
58
59
60
name: Tests
on:
pull_request:
branches:
- "main"
env:
# todo(nimish): extend to matrix of python versions/OS
AWS_REGION: "us-west-1"
USE_MOSEK: "false"
jobs:
run-tests:
runs-on: ubuntu-latest
environment: test
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
if: env.USE_MOSEK == 'true'
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Setup Mosek License File
if: env.USE_MOSEK == 'true'
env:
MOSEK_LICENSE: "s3://slac.gismo.ci.artifacts/mosek.license/mosek.lic"
run: |
sudo mkdir /root/mosek
mkdir $HOME/mosek
aws s3 cp ${{env.MOSEK_LICENSE}} $HOME/mosek/mosek.lic
sudo cp $HOME/mosek/mosek.lic /root/mosek/mosek.lic
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-tags: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python Dependencies
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install --system --break-system-packages -r requirements.txt
uv pip install --system --break-system-packages pytest pytest-cov pytest-github-report pytest-github-actions-annotate-failures
- name: Run Unit Tests
env:
pytest_github_report: true
pytest_verbosity: 2
run: pytest -v --cov=src --cov-report=xml --cov-report=term-missing --color=yes tests/