From b52bf624bf462572e45aa59740008c34941e687c Mon Sep 17 00:00:00 2001 From: oberrich Date: Sun, 29 Dec 2024 05:59:34 +0100 Subject: [PATCH] ci: upload artifacts Co-authored-by: Irate-Walrus <71628949+Irate-Walrus@users.noreply.github.com> --- .github/workflows/rust.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c943d0e..7ef2cfc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,9 +3,9 @@ name: "cargo" on: workflow_dispatch: push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] + branches: ["master"] env: CARGO_TERM_COLOR: always @@ -32,6 +32,7 @@ jobs: # Extract architecture (i686, x86_64 or aarch64) from target triple ARCH=$(echo "${{ matrix.target }}" | cut -d'-' -f1) echo "Extracted architecture: $ARCH" + # Map i686 to x86 if [ "$ARCH" == "i686" ]; then ARCH="x86" @@ -50,6 +51,13 @@ jobs: # Move the generated file to the repository directory cp "$GENERATED_BINDING" "src/ffi/${ARCH}_bindgen.rs" echo "Moved $GENERATED_BINDING to src/ffi/${ARCH}_bindgen.rs" + + - name: Upload generated file as artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.ARCH }}_bindgen.rs + path: src/ffi/${{ env.ARCH }}_bindgen.rs + - name: Run tests run: cargo test --verbose commit-and-push: @@ -79,7 +87,7 @@ jobs: git add src/ffi # Check if there are any changes to commit - if git diff --exit-code --cached; then + if git diff --quiet --exit-code --cached; then echo "No changes to commit." else git commit -m "Update bindgen files"