Edit Dockerfile.model to use --platform #173
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Example repository checks | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Verify that all examples have an entry in top-README | |
run: | | |
# Find directories that do not start with dot | |
acap_list="$(find . -maxdepth 1 -type d -printf '%f\n' |grep -v '^[.]' | sort)" | |
# Find example application links in README.md | |
# The regular expression '^\* \[[0-9a-z-]*\]' matches lines starting with '* [' | |
# followed by alphanumeric characters and hyphens, and a closing ']' | |
example_links="$(grep -o '^\* \[[0-9a-z-]*\]' README.md)" | |
# Remove '* [' prefix and trailing ']' from example links | |
# The sed command uses two substitutions: | |
# 1. 's/^\* \[//' removes the '* [' prefix from the start of the line | |
# 2. 's/\]$//' removes the trailing ']' from the end of the line | |
readme_examples="$(echo "$example_links" | sed 's/^\* \[//;s/\]$//')" | |
# Control that all examples have an entry in README | |
common=$(printf "${acap_list}\n${readme_examples}" | sort | uniq -d) | |
unique=$(printf "${acap_list}\n${readme_examples}" | sort | uniq -u) | |
[ -z "$unique" ] || { | |
printf "\n\nERROR: Mismatch between example directories and entries in README.md:\n$unique\n\n" | |
exit 1 | |
} | |
printf "\n\nAll example directories have entries in README.md:\n$common\n\n" | |
# Control that the README entries are sorted alphabetically ascending | |
sorted_list="$(printf "$readme_examples" | sort)" | |
[ "$readme_examples" = "$sorted_list" ] || { | |
printf "\n\nERROR: The list of example entries in README.md is not sorted alphabetically(left column has current order):\n" | |
diff -y <(echo "$readme_examples") <(echo "$sorted_list") | |
exit 1 | |
} | |
printf "\n\nAll examples are sorted in alphabetical order in README.md." |