Kate
1 year ago
committed by
GitHub
4 changed files with 127 additions and 0 deletions
@ -0,0 +1,21 @@
|
||||
name: Neon |
||||
on: |
||||
push: |
||||
branches: |
||||
- main |
||||
pull_request: |
||||
|
||||
concurrency: |
||||
group: neon-${{ github.head_ref || github.run_id }} |
||||
cancel-in-progress: true |
||||
|
||||
jobs: |
||||
untested-apis: |
||||
name: Untested APIs |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Checkout repository |
||||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 |
||||
|
||||
- name: Find untested Neon APIs |
||||
run: ./tool/find-untested-neon-apis.sh |
@ -0,0 +1,33 @@
|
||||
#!/bin/bash |
||||
set -euxo pipefail |
||||
cd "$(dirname "$0")/.." |
||||
|
||||
function find_apis() { |
||||
path="$1" |
||||
grep -r "$path" --include "*\.dart" -e "client\.[^.]*.[^(]*(" -oh | sed "s/^client\.//" | sed "s/($//" | sed "s/Raw$//" | sort | uniq |
||||
} |
||||
|
||||
used_apis=("$(find_apis "packages/neon")") |
||||
tested_apis=("$(find_apis "packages/nextcloud")") |
||||
|
||||
untested_apis=() |
||||
|
||||
for used_api in ${used_apis[*]}; do |
||||
tested=0 |
||||
|
||||
for tested_api in ${tested_apis[*]}; do |
||||
if [[ "$tested_api" == "$used_api" ]]; then |
||||
tested=1 |
||||
break |
||||
fi |
||||
done |
||||
|
||||
if [[ "$tested" == 0 ]]; then |
||||
untested_apis+=("$used_api") |
||||
fi |
||||
done |
||||
|
||||
if [[ -n "${untested_apis[*]}" ]]; then |
||||
printf "%s\n" "${untested_apis[@]}" |
||||
exit 1 |
||||
fi |
Loading…
Reference in new issue