Files
tycho-protocol-sdk/.github/workflows/python-tests.yaml
Khramtsov Valentin e413284017 chore: fix for old aws account id (#149)
* chore: fix for old aws account id

* chore: fix for old aws account id

* chore: test with changed branch

* chore: test with changed branch

* chore: test with install dependencies

* chore: prepare to pr
2025-02-05 11:09:51 +01:00

64 lines
1.8 KiB
YAML

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