-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from storyprotocol/origin/bpolania/python-wor…
…kflow Origin/bpolania/python workflow
- Loading branch information
Showing
2 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
.github/workflows/reusable-build-python-integration-test-workflow.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build and Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
sha: | ||
required: true | ||
type: string | ||
ENVIRONMENT: | ||
required: true | ||
type: string | ||
secrets: | ||
WALLET_PRIVATE_KEY: | ||
required: true | ||
RPC_PROVIDER_URL: | ||
required: true | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and Test | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.ENVIRONMENT }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11"] | ||
env: | ||
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} | ||
RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # Caches pip dependencies | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt || exit ` | ||
pip install pytest pytest-cov # Common testing packages | ||
shell: bash | ||
|
||
- name: Run integration tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/integration/ --cov=./ --cov-report=xml |
56 changes: 56 additions & 0 deletions
56
.github/workflows/reusable-build-python-unit-test-workflow.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build and Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
sha: | ||
required: true | ||
type: string | ||
ENVIRONMENT: | ||
required: true | ||
type: string | ||
secrets: | ||
WALLET_PRIVATE_KEY: | ||
required: true | ||
RPC_PROVIDER_URL: | ||
required: true | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and Test | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.ENVIRONMENT }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11"] | ||
env: | ||
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} | ||
RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | ||
with: | ||
ref: ${{ inputs.sha }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # Caches pip dependencies | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt || exit 1 | ||
pip install pytest pytest-cov # Common testing packages | ||
shell: bash | ||
|
||
- name: Run Unit tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest tests/unit/ --cov=./ --cov-report=xml |