diff --git a/.github/workflows/py-lint-test.yml b/.github/workflows/py-lint-test.yml index 7e5cffcf..39d7f626 100644 --- a/.github/workflows/py-lint-test.yml +++ b/.github/workflows/py-lint-test.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/py-publish.yml b/.github/workflows/py-publish.yml index 1165db02..a91ae41a 100644 --- a/.github/workflows/py-publish.yml +++ b/.github/workflows/py-publish.yml @@ -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 @@ -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 @@ -37,4 +45,4 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - twine upload -r pypi dist/* \ No newline at end of file + poetry run twine upload -r pypi dist/* \ No newline at end of file