Skip to content

Commit

Permalink
some changes present
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Aug 6, 2024
1 parent 2eedc1f commit 08b0b1d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
19 changes: 14 additions & 5 deletions .github/actions/validate-solidity-artifacts/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,17 @@ runs:
steps:
- name: Fetch base ref
if: ${{ inputs.base_ref != '' }}
id: fetch_base_ref
shell: bash
run: git fetch origin ${{ inputs.base_ref }}
run: |
if git cat-file -t "${{ inputs.base_ref }}" 2>/dev/null | grep -q commit; then
# we do not know to which branch the base ref belongs, so we fetch all branches
git fetch --all --prune
echo "ref_to_use=${{ inputs.base_ref }}" >> $GITHUB_OUTPUT
else
git fetch origin ${{ inputs.base_ref }}
echo "ref_to_use=origin/${{ inputs.base_ref }}" >> $GITHUB_OUTPUT
fi
- name: Transform input array
id: transform_input_array
shell: bash
Expand Down Expand Up @@ -72,13 +81,13 @@ runs:
if: ${{ inputs.validate_uml_diagrams == 'true' }}
shell: bash
run: |
echo "Validating UML diagrams"
echo "Validating UML diagrams"
IFS=',' read -r -a modified_files <<< "${{ steps.transform_input_array.outputs.sol_files }}"
missing_svgs=()
missing_svgs=()
for file in "${modified_files[@]}"; do
if [ "${{ inputs.base_ref }}" != "" ]; then
# TODO remove this check when AurorNZ/paths-filter is fixed
status=$(git diff --name-status origin/${{ inputs.base_ref }} HEAD -- "$file" | awk '{ print $1 }')
status=$(git diff --name-status "${{ steps.fetch_base_ref.outputs.ref_to_use }}" HEAD -- "$file" | awk '{ print $1 }')
if [ "$status" == "D" ]; then
echo "File $file was deleted, skipping validation"
continue
Expand Down Expand Up @@ -114,7 +123,7 @@ runs:
for file in "${modified_files[@]}"; do
if [ "${{ inputs.base_ref }}" != "" ]; then
# TODO remove this check when AurorNZ/paths-filter is fixed
status=$(git diff --name-status origin/${{ inputs.base_ref }} HEAD -- "$file" | awk '{ print $1 }')
status=$(git diff --name-status "${{ steps.fetch_base_ref.outputs.ref_to_use }}" HEAD -- "$file" | awk '{ print $1 }')
if [ "$status" == "D" ]; then
echo "File $file was deleted, skipping validation"
continue
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solidity-foundry-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
gather-basic-info:
name: Gather basic info
if: ${{ steps.changes.outputs.product == 'true' || steps.changes.outputs.shared == 'true' }}
if: ${{ needs.changes.outputs.product_changes == 'true' || needs.changes.outputs.shared_changes == 'true' }}
runs-on: ubuntu-22.04
needs: [ changes ]
steps:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/solidity-hardhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
FOUNDRY_PROFILE: ci
# Has to match the `make foundry` version.
FOUNDRY_VERSION: nightly-de33b6af53005037b463318d2628b5cfcaf39916
base_ref: "f5e0bd614a6c42d195c4ad74a10f7070970d01d5"
base_ref: "1b4cb83bae78c398ad8ae6e47dbbe747ff93133e"
product: "keystone"

jobs:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- 'contracts/src/v0.8/**/*.sol'
- *ignored
product: &product
- 'contracts/src/v0.8/${{ env.product }}/**/*.sol'
- 'contracts/src/v0.8/${{ env.product }}/**/*.sol'
- *ignored
included:
- *product
Expand Down Expand Up @@ -422,5 +422,7 @@ jobs:
echo "Base Ref used: **${{ env.base_ref }}**" >> $GITHUB_STEP_SUMMARY
echo "Commit SHA used: **${{ github.sha }}**" >> $GITHUB_STEP_SUMMARY
echo "## Reason: No modified Solidity files found for ${{ env.product }}" >> $GITHUB_STEP_SUMMARY
echo "No modified Solidity files found between ${{ env.base_ref }} and ${{ github.sha }} commits or they are located outside of ./contracts/src/v0.8 folder" >> $GITHUB_STEP_SUMMARY
echo "* no modified Solidity files found between ${{ env.base_ref }} and ${{ github.sha }} commits" >> $GITHUB_STEP_SUMMARY
echo "* or they are located outside of `./contracts/src/v0.8` folder" >> $GITHUB_STEP_SUMMARY
echo "* or they were limited to test files" >> $GITHUB_STEP_SUMMARY
exit 1

0 comments on commit 08b0b1d

Please sign in to comment.