-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.4 KB
/
tests.yaml
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
61
62
63
64
65
66
67
name: Tests
on:
- push
- pull_request
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
run: uv tool install --with "tox-uv,tox-gh-actions" tox
- name: Prepare test environment
run: |
cp tests/data/credentials_fake.json credentials.json
echo "EDUTAP_WALLET_GOOGLE_ISSUER_ID=1234567890123456789" > .env
- name: Test with tox
run: tox
integration-tests:
needs: unit-tests
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
environment:
name: Integration-Tests
url: https://pypi.org/edutap-eu/edutap.wallet_google/
steps:
- uses: actions/checkout@v4
- name: Check for changed models or API
id: changed-models-or-api
uses: tj-actions/changed-files@v45
with:
files: |
src/edutap/wallet_google/models/**
src/edutap/wallet_google/api.py
- name: Install the latest version of uv
if: steps.changed-models-or-api.outputs.any_changed == 'true'
uses: astral-sh/setup-uv@v4
with:
python-version: '3.13'
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
if: steps.changed-models-or-api.outputs.any_changed == 'true'
run: uv tool install --with "tox-uv,tox-gh-actions" tox
- name: Prepare test environment
if: steps.changed-models-or-api.outputs.any_changed == 'true'
run: |
echo "${{ secrets.SERVICE_ACCOUNT_JSON }}" > /tmp/edutap-wallet-google-credentials.json
echo "EDUTAP_WALLET_GOOGLE_ISSUER_ID=${{ secrets.ISSUER_ID }}" > .env
echo "EDUTAP_WALLET_GOOGLE_CREDENTIALS_FILE=/tmp/edutap-wallet-google-credentials.json" >> .env
echo "EDUTAP_WALLET_GOOGLE_INTEGRATION_TEST_PREFIX=${{ github.run_id }}" >> .env
- name: Test with tox
if: steps.changed-models-or-api.outputs.any_changed == 'true'
run: tox -- --run-integration