Skip to content

Commit

Permalink
Fixes errors with external repositories (#36)
Browse files Browse the repository at this point in the history
* Fixes the error whit chroot when no shared-dir is provided
* Replaces the `pwd` command with GITHUB_WORKSPACE variable in
 composite action
* Fixed the errors with sideloading python packages on external
repositories
  • Loading branch information
WiktorOgrodnik authored May 15, 2023
1 parent 743e7ca commit 6f01cda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ runs:

- id: test
run: |
PWD=$(pwd) \
cd ${GITHUB_ACTION_PATH} && sudo python3 action/run-in-renode.py \
'${{ toJSON(inputs) }}' "$PWD"
'${{ toJSON(inputs) }}' "${GITHUB_WORKSPACE}"
shell: bash
4 changes: 2 additions & 2 deletions action/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def add_packages(packages: str):
run_cmd(child, "#", "mkdir -p pip")
shared_directories_actions.append(
shared_directories_action(
"pip",
f"{os_getcwd()}/pip",
"/var/packages",
)
)
Expand Down Expand Up @@ -154,7 +154,7 @@ def add_repos(repos: str):

shared_directories_actions.append(
shared_directories_action(
"repos",
f"{os_getcwd()}/repos",
"/home",
)
)
4 changes: 2 additions & 2 deletions action/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def burn_rootfs_image(user_directory: str, rootfs_size: str):
size of the rootfs in a format used by tools like truncate or auto to be calculated automatically
"""

os_makedirs("images/rootfs")
os_makedirs("images/rootfs/home")

with tarfile_open("images/rootfs.tar") as tar:
tar.extractall("images/rootfs")

for dir in shared_directories_actions:
os_makedirs(f"images/rootfs/{dir.target}", exist_ok=True)
copytree(
f"{user_directory}/{dir.host}",
f"{user_directory}/{dir.host}" if not dir.host.startswith('/') else dir.host,
f"images/rootfs/{dir.target}",
dirs_exist_ok=True
)
Expand Down

0 comments on commit 6f01cda

Please sign in to comment.