File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 10
10
jobs :
11
11
coverage :
12
12
runs-on : ubuntu-latest
13
+ permissions :
14
+ pull-requests : write
13
15
steps :
14
16
- name : Checkout Repo
15
17
uses : actions/checkout@v2
24
26
run : |
25
27
docker build . --tag opensearch-with-api-plugin
26
28
docker run -d -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e OPENSEARCH_INITIAL_ADMIN_PASSWORD="${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }}" opensearch-with-api-plugin
27
- sleep 30
29
+ sleep 15
28
30
- name : Display OpenSearch Info
29
31
run : |
30
32
curl -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} --insecure https://localhost:9200/ | jq
38
40
cat diff.json | jq '.newEndpoints | group_by(.pathUrl)[] | .[0].pathUrl + ": " + (map(.method) | tostring)' --raw-output
39
41
echo "-------- Legacy APIs"
40
42
cat diff.json | jq '.missingEndpoints | group_by(.pathUrl)[] | .[0].pathUrl + ": " + (map(.method) | tostring)' --raw-output
41
-
43
+ - name : Gather Coverage
44
+ id : coverage
45
+ shell : bash
46
+ run : |
47
+ echo "current=`cat OpenSearch.openapi.json | jq '.paths | keys[]' | wc -l`" >> $GITHUB_OUTPUT
48
+ echo "total=`cat OpenSearch.auto.openapi.json | jq '.paths | keys[]' | wc -l`" >> $GITHUB_OUTPUT
49
+ - name : Calculate Percent
50
+ id : math
51
+ shell : bash
52
+ run : |
53
+ echo "percent=$((${{ steps.coverage.outputs.current }}*100/${{ steps.coverage.outputs.total }}))" >> $GITHUB_OUTPUT
54
+ - name : Report Coverage
55
+ shell : bash
56
+ run : |
57
+ echo "API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} (${{ steps.math.outputs.percent }}%) APIs."
58
+ # - uses: mshick/add-pr-comment@v2
59
+ # with:
60
+ # message: |
61
+ # API specs implemented for ${{ steps.coverage.outputs.current }}/${{ steps.coverage.outputs.total }} (${{ steps.math.outputs.percent }}%) APIs.
You can’t perform that action at this time.
0 commit comments