Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion .github/actions/check-downstream-compiles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ inputs:
required: false
default: false
type: boolean
# Comma-separated list of crates to patch further down the dependency chain
more-paths:
description: 'Paths to further downstream'
required: false
type: string

runs:
using: "composite"
Expand Down Expand Up @@ -78,7 +83,38 @@ runs:
# Append all patches after the `[patch.'ssh']` line
sed -i "/\[patch.'$ESCAPED_URL'\]/r patches.txt" $file
done

# If more crates were specified, patch them too
if [[ ! -z "${{ inputs.more-paths }}" ]]; then
for path in "${{ inputs.more-paths }}"; do
for file in $(find $path -name Cargo.toml -not -path "./target/*"); do
# Add the `[patch]` section if it doesn't exist already, as duplicates aren't allowed
if ! grep -q "\[patch.'$URL'\]" $file; then
printf "\n\n[patch.'$URL']\n" >> $file
# If `[patch]` does exist, remove any duplicate keys before inserting patches
else
for crate in $DEP_NAMES; do
sed -i "/\[patch.'$ESCAPED_URL'\]/,/^$/ { /^$crate.*$/d }" $file
done
fi

# Append all patches after the `[patch.'ssh']` line
sed -i "/\[patch.'$ESCAPED_URL'\]/r patches.txt" $file
done
done
fi
- name: Check downstream types don't break spectacularly
shell: bash
working-directory: ${{ github.workspace }}/${{ inputs.downstream-path }}
run: cargo check --workspace --tests --benches --examples
run: |
cargo check --workspace --tests --benches --examples
- name: Check more downstream types don't break spectacularly
if: ${{ inputs.more-paths != '' }}
shell: bash
working-directory: ${{ github.workspace }}
run: |
for path in "${{ inputs.more-paths }}"; do
cd $path
cargo check --workspace --tests --benches --examples
cd ${{ github.workspace }}
done