Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .github/workflows/validate-pr-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
shell: bash
- name: test implement-cowsay
id: test-implement-cowsay
if: contains(steps.changed-files.outputs.modified_files, 'implement-cowsay/')
if: contains(steps.changed-files.outputs.all_modified_files, 'implement-cowsay/')
run: ./test-sdc.sh implement-cowsay
shell: bash
- name: make output comment
Expand All @@ -59,6 +59,8 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.pull_request.html_url }}
run: |
gh release -R CodeYourFuture/trainee-tracker view --json assets -q ".assets[] | select(.name | startswith(\"pr-metadata-validator-musl-\")).url" | xargs curl --fail -L -o /tmp/pr-metadata-validator && chmod 0755 /tmp/pr-metadata-validator
/tmp/pr-metadata-validator --only-close-existing-comments-with-tag="sdc-test-results" "${ISSUE_URL}"
gh pr comment $ISSUE_URL --body-file testoutput.txt
- name: add appropriate labels
if: steps.test-individual-shell-tools.outputs.complete == 'y' || steps.test-jq.outputs.complete == 'y' || steps.test-shell-pipelines.outputs.complete == 'y' || steps.test-implement-cowsay.outputs.complete == 'y'
Expand Down
9 changes: 5 additions & 4 deletions test-sdc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# You can run this file using ./test-sdc.sh task-directory-name to check your output

echo "<!--CYFTT tag: sdc-test-results-->" > testoutput.txt
echo "Results of test" >> testoutput.txt
echo "Results of test:" >> testoutput.txt

if [[ "$1" == "individual-shell-tools" ]]; then
cd individual-shell-tools
Expand Down Expand Up @@ -148,14 +148,14 @@ elif [[ "$1" == "implement-cowsay" ]]; then
python3 implement-cowsay/cow.py Grass, delicious > test.tmp
cmp test.tmp expect/implement-cowsay/cow-grass.txt
if [ $? -ne 0 ]; then
echo "Unexpected cowsay output for Grass, delicious" >> testoutput.txt
echo "Unexpected cowsay output for 'Grass, delicious'." >> testoutput.txt
all_ok=false
fi

python3 implement-cowsay/cow.py --animal turtle "Fish are cool!" > test.tmp
cmp test.tmp expect/implement-cowsay/turtle-fish.txt
if [ $? -ne 0 ]; then
echo "Unexpected cowsay output for Fish are cool!" >> testoutput.txt
echo "Unexpected cowsay output for --animal turtle Fish are cool!" >> testoutput.txt
all_ok=false
fi

Expand All @@ -172,7 +172,8 @@ elif [[ "$1" == "implement-cowsay" ]]; then
fi

if [[ "${all_ok}" == "true" && -v GITHUB_OUTPUT ]]; then
echo "completed=y" >> "$GITHUB_OUTPUT"
echo "complete=y" >> "$GITHUB_OUTPUT"
echo "Your implementation passed all checks." >> testoutput.txt
fi
fi
fi
Expand Down
Loading