Skip to content

Commit

Permalink
[ci] fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
8baller committed Nov 9, 2023
1 parent 881160f commit f2934d9
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 29 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/common_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10",]
python-version: ["3.8", "3.9", "3.10", "3.11"]
poetry-version: ["1.3.2"]
os: [ubuntu-20.04,]
runs-on: ${{ matrix.os }}
Expand All @@ -32,20 +32,27 @@ jobs:
with:
version: ${{ matrix.poetry-version }}
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/my-custom-path
installer-parallel: true

- name: Install Adev
- name: Install Packages
run: |
bash auto_dev/data/repo/templates/autonomy/install.sh
poetry install -v
- name: Format
- name: Install Host Dependencies
run: |
poetry run adev -n 0 -v fmt -p .
poetry run python script/install.py
- name: Lint
run: |
poetry run adev -n 0 -v lint -p .
poetry run adev lint -p tests
poetry run adev lint -p rysk_client
- name: Tests
run: |
poetry run adev -v test -p .
- name: Doc Tests
run: |
make test-docs
22 changes: 0 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# - name: Get Changelog Entry
# id: changelog_reader
# uses: mindsers/changelog-reader-action@v2
# with:
# validation_depth: 10
# version: ${{ steps.tag_name.outputs.current_version }}
# path: ./CHANGELOG.md

- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-versions }}
Expand All @@ -51,24 +43,10 @@ jobs:
python -m pip install --upgrade pip
pip install poetry
- name: build documentation
run: |
poetry install -E doc
poetry run mkdocs build
# - name: publish documentation
# uses: peaceiris/actions-gh-pages@v3
# with:
# personal_token: ${{ secrets.PERSONAL_TOKEN }}
# publish_dir: ./site

- name: Build wheels and source tarball
run: >-
poetry build
- name: show temporary files
run: >-
ls -l
- name: create github release
id: create_release
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ fmt:
lint:
poetry run flake8 tests lyra

all: fmt lint tests
all: fmt lint tests

test-docs:
echo making docs
64 changes: 64 additions & 0 deletions install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""
Installations for the necessary packages.
"""

import os
from dataclasses import dataclass

from rich.progress import track

from rysk_client.src.utils import get_logger

logger = get_logger()


@dataclass
class HostDependency:
"""
represents a host dependency
"""

name: str
install_cmd: str

def is_present(self) -> bool:
"""
silently check if the dependency is present on the host
"""
return os.popen(f"which {self.name}").read() != ""

def install(self) -> None:
"""
install the dependency
"""
os.system(self.install_cmd)


def install_dependencies() -> None:
"""
install the dependencies
"""
dependencies = [
(
"rustc",
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh",
),
(
"anvil",
"git clone https://github.com/foundry-rs/foundry && "
+ "cd foundry && "
+ "cargo install --path ./anvil --bins --locked --force && "
+ "rm -rf ../foundry",
),
]
logger.info(f"Installing {len(dependencies)} dependencies")
for dependency in track(dependencies):
dep = HostDependency(*dependency)
if not dep.is_present():
logger.info(f"Installing {dep.name}")
# dep.install()
logger.info("Done!")


if __name__ == "__main__":
install_dependencies()

0 comments on commit f2934d9

Please sign in to comment.