Skip to content

Commit

Permalink
forgot to add in actions changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajames committed Jun 20, 2024
1 parent b682306 commit 7a649f2
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 29 deletions.
54 changes: 35 additions & 19 deletions .github/workflows/py-lint-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "[v4-client-py] Lint, Test"
name: "[v4-client-py-v2] Lint, Test"

on: # yamllint disable-line rule:truthy
pull_request:
Expand All @@ -12,28 +12,36 @@ on: # yamllint disable-line rule:truthy
- "release/*"

jobs:
# lint:
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./v4-client-py-v2
# steps:
# - name: Check out repository code
# uses: actions/checkout@v3
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./v4-client-py-v2
steps:
- name: Check out repository code
uses: actions/checkout@v3

# - name: Set up Python 3.12
# uses: actions/setup-python@v4
# with:
# python-version: 3.12
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12

# - name: Install poetry
# run: pip install poetry
- name: Cache poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
# - name: Install Dependencies
# run: poetry install
- name: Install poetry
run: pip install poetry

# - name: Lint
# run: flake8
- name: Install Dependencies
run: poetry install

- name: Lint
run: poetry run black --check ./dydx_v4_client ./tests ./examples

test:
runs-on: ubuntu-latest
Expand All @@ -49,6 +57,14 @@ jobs:
with:
python-version: 3.12

- name: Cache poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install poetry
run: pip install poetry

Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/py-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "[v4-client-py] Publish to PyPI"
name: "[v4-client-py-v2] Publish to PyPI"

on: # yamllint disable-line rule:truthy
push:
paths:
- 'v4-client-py/**'
- 'v4-client-py-v2/**'
branches:
- main

Expand All @@ -13,21 +13,29 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./v4-client-py
working-directory: ./v4-client-py-v2
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.11
python-version: 3.12

- name: Install Dependencies
run: pip install -r requirements-publish.txt
- name: Cache poetry dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Poetry dependencies
run: poetry install --no-root
- name: Install poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Build package
run: poetry build
Expand All @@ -37,4 +45,4 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload -r pypi dist/*
poetry run twine upload -r pypi dist/*

0 comments on commit 7a649f2

Please sign in to comment.