forked from propeller-heads/tycho-protocol-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (56 loc) · 1.77 KB
/
python-tests.yaml
File metadata and controls
63 lines (56 loc) · 1.77 KB
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
name: Test code using pytest
on:
workflow_call:
inputs:
runs_on:
required: false
type: string
default: ubuntu-latest
timeout_minutes:
required: false
type: number
default: 15
secrets:
role-to-assume:
required: true
aws-region:
required: true
domain-owner:
required: true
jobs:
test-python:
runs-on: "${{ inputs.runs_on }}"
timeout-minutes: "${{ inputs.timeout_minutes }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Cache Env
uses: actions/cache@v3
id: env-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('./propeller-swap-encoders/requirements.txt') }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4.0.1
with:
role-to-assume: ${{ secrets.role-to-assume }}
audience: sts.amazonaws.com
aws-region: ${{ secrets.aws-region }}
- name: Install Dependencies
if: ${{ steps.env-cache.outputs.cache-hit != 'true' }}
run: |
aws codeartifact login --tool pip --domain propeller --domain-owner ${{secrets.domain-owner}} --repository protosim
python -m pip install --upgrade pip
pip install -r propeller-swap-encoders/requirements.txt --no-cache
shell: bash
- name: Test with pytest
id: tests
run: |
export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/propeller-swap-encoders
pytest --disable-warnings ./propeller-swap-encoders