Skip to content

Commit

Permalink
ci: Add a workflow for tracking @todo-s (#673)
Browse files Browse the repository at this point in the history
* Add a script and workflow for tracking `@todo-`s

* [REVERT THIS] Test out the script

* Add name to the workflow

* Revert "[REVERT THIS] Test out the script"

This reverts commit 4789bf9.

* No longer test @todo-framework
  • Loading branch information
wlee221 authored Nov 11, 2021
1 parent db695a4 commit 248121b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
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

0 comments on commit 248121b

Please sign in to comment.