Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add a workflow for tracking @todo-s #673

Merged
merged 5 commits into from
Nov 11, 2021
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
19 changes: 19 additions & 0 deletions .github/scripts/track-todos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# total number of .feature files that has unresolved @todo-tags
nTodoFiles=$(grep -R -e "@todo-*" ./packages/e2e/features/ -l | wc -l | sed -e 's/^[ \t]*//');

red="\033[0;31m"
nocolor="\033[0m"

if [ ${nTodoFiles} -gt 0 ]; then
echo "\n---------"
echo "ERROR: There are ${red}${nTodoFiles}${nocolor} feature files with @todo tags."
echo "---------"

grep -RIci "@todo-" ./packages/e2e/features/ | awk -v FS=":" '$2>0 { print $1, "has", $2, "@todo tags." }';
echo "\n"
exit 1;
else
echo "🎉 No @todo tags were found."
fi
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ jobs:
matrix:
include:
- framework: angular
tags: ${{ contains(github.ref, 'main') && '@angular and not @skip' || '@angular and not (@skip or @todo-angular)' }}
tags: '@angular and not (@skip or @todo-angular)'

- framework: next
tags: ${{ contains(github.ref, 'main') && '@react and not @skip' || '@react and not (@skip or @todo-react)' }}
tags: '@react and not (@skip or @todo-react)'

- framework: vue
tags: ${{ contains(github.ref, 'main') && '@vue and not @skip' || '@vue and not (@skip or @todo-vue)' }}
tags: '@vue and not (@skip or @todo-vue)'

steps:
- name: Checkout Amplify UI
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/track-todos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Track @TODOs

on:
push:
branches: [main]

jobs:
publish:
runs-on: ubuntu-latest
environment: ci
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Track TODOs
run: chmod +x ./.github/scripts/track-todos.sh && ./.github/scripts/track-todos.sh