Skip to content

Commit

Permalink
feat(pipe): debug pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed Jan 5, 2023
1 parent d77c6ba commit 7abd905
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,24 +166,17 @@ jobs:
# Prepare rust-cross/rust-musl-cross for cross compiling
source prep-build-env.sh
# Cleanup target dir
# TODO: Remove this once we know what is produces here
sudo rm -rf target
# Compile the desired target
build-rust-static-bin ${{ matrix.target }}
# Stage the binary for the next step
bash stage-arch-bin.sh this-week-in-past
ls -la target
file target/**/this-week-in-past
# Translate ${{ matrix.target }} to rust target triple
echo "::set-env name=TARGET_TRIPPLE::$(bash translate-arch-to-rust-tripple.sh)"
- name: Upload static application binaries
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ./this-week-in-past
path: target/${{ env.TARGET_TRIPPLE }}/release/this-week-in-past


test-container-image:
Expand Down
24 changes: 24 additions & 0 deletions translate-arch-to-rust-tripple.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# Description:
# Translates the current cpu architecture to the a rust triple.
#
# # # #

CURRENT_ARCH=$(uname -m)

if [ "$CURRENT_ARCH" = "armv7l" ]; then
CURRENT_ARCH="armv7"
fi

# Iterate all folders in the target folder
for arch_folder in $(find target -maxdepth 1 -type d); do
# Check if the folder name contains the current arch
if [[ "$arch_folder" = *"$CURRENT_ARCH"* ]]; then
RUST_TRIPLE=$(echo "$arch_folder" | sed -e "s/.*\///g")
echo "$RUST_TRIPLE"
exit 0
fi
done

exit 1

0 comments on commit 7abd905

Please sign in to comment.