Skip to content

Commit

Permalink
fix: Correct upload/download-artifact usage
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz committed Jan 15, 2024
1 parent 9867df6 commit d04f26d
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/sync-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- name: Upload lockfile
uses: actions/upload-artifact@v3
with:
name: Cargo.lock
path: Cargo.lock

sync:
Expand Down Expand Up @@ -59,27 +60,25 @@ jobs:
# NOTE: Not all Zenoh dependants have their Cargo manifest and lockfile
# at the repository's toplevel. The only exception being zenoh-kotlin and
# zenoh-java. Thus the need for this ugly workaround.
- name: Compute Cargo manifest & lockfile paths of ${{ matrix.dependant }}
id: get-paths
# NOTE: We assume that the lockfile resides in the same directory as the manifest.
- name: Compute crate path of ${{ matrix.dependant }}
id: crate-path
run: |
if [[ "${{ matrix.dependant }}" =~ zenoh-(java|kotlin) ]]; then
echo "manifest=./zenoh-jni/Cargo.toml" >> $GITHUB_OUTPUT
echo "lockfile=./zenoh-jni/Cargo.lock" >> $GITHUB_OUTPUT
echo "value=zenoh-jni" >> $GITHUB_OUTPUT
else
echo "manifest=./Cargo.toml" >> $GITHUB_OUTPUT
echo "lockfile=./Cargo.lock" >> $GITHUB_OUTPUT
echo "value=." >> $GITHUB_OUTPUT
fi
- name: Override ${{ matrix.dependant }} lockfile with Zenoh's
uses: actions/download-artifact@v3
with:
path: ${{ steps.get-paths.outputs.lockfile }}
name: Cargo.lock
path: ${{ steps.crate-path.outputs.value }}

- name: Rectify lockfile
# NOTE: Checking the package for errors will rectify the Cargo.lock while preserving
# the dependency versions fetched from source.
run: cargo check --manifest-path ${{ steps.get-paths.outputs.manifest }}
run: cargo check --manifest-path ${{ steps.crate-path.outputs.value }}/Cargo.toml

- name: Create/Update a pull request if the lockfile changed
id: cpr
Expand Down

0 comments on commit d04f26d

Please sign in to comment.