Skip to content

Commit

Permalink
ci - debug disk
Browse files Browse the repository at this point in the history
  • Loading branch information
aprxi committed Aug 11, 2024
1 parent b2658fd commit 58778b1
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check disk usage
run: df -h
- name: Prepare build directories (Ubuntu only)
if: runner.os == 'Linux'
run: |
sudo mkdir -p /mnt/cargo-build /mnt/cargo-home /mnt/rustup-home
sudo chmod 777 /mnt/cargo-build /mnt/cargo-home /mnt/rustup-home
- name: Install and configure dependencies
run: |
Expand All @@ -71,12 +74,11 @@ jobs:
linker = "aarch64-linux-gnu-gcc"
EOF
- name: Check disk usage
run: df -h

- name: Install target
run: rustup target add $TARGET

env:
RUSTUP_HOME: ${{ runner.os == 'Linux' && '/mnt/rustup-home' || '' }}

- name: Check disk usage
run: df -h

Expand Down Expand Up @@ -104,20 +106,32 @@ jobs:
- name: Build project
run: cargo build -p $NAME --release --target $TARGET
env:
CARGO_TARGET_DIR: ${{ runner.os == 'Linux' && '/mnt/cargo-build' || '' }}
CARGO_HOME: ${{ runner.os == 'Linux' && '/mnt/cargo-home' || '' }}

- name: Check disk usage
run: df -h

- name: List target directory
run: ls target/${{ matrix.target }}/release
run: |
if [[ $OS =~ ^ubuntu.*$ ]]; then
ls /mnt/cargo-build/$TARGET/release
else
ls target/$TARGET/release
fi
- name: Compress
run: |
[ -e ./build ] && rm -rf ./build
[ -e ./artifacts ] && rm -rf ./artifacts
mkdir -p ./artifacts ./build/bin
TAG=${{ needs.prebuild.outputs.release_tag }}
mv ./target/$TARGET/release/$NAME ./build/bin/$NAME
if [[ $OS =~ ^ubuntu.*$ ]]; then
mv /mnt/cargo-build/$TARGET/release/$NAME ./build/bin/$NAME
else
mv ./target/$TARGET/release/$NAME ./build/bin/$NAME
fi
OUTFILE=./artifacts/$NAME-$TARGET-$TAG.tar.gz
tar -czf $OUTFILE -C ./build .
shasum -a 256 $OUTFILE > $OUTFILE.sha256
Expand Down

0 comments on commit 58778b1

Please sign in to comment.