Skip to content

Commit 1399361

Browse files
Merge pull request #328 from stackql/dev
static-analyisis-pattern
2 parents 42775c3 + 78e4e8c commit 1399361

File tree

4 files changed

+168
-1
lines changed

4 files changed

+168
-1
lines changed

.github/workflows/aot.yml

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: AOT Provider Analysis
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- dev
8+
push:
9+
branches:
10+
- main
11+
- dev
12+
tags:
13+
- aot*
14+
15+
env:
16+
IS_TAG: ${{ github.ref_type == 'tag' }}
17+
GO_VERSION: '~1.22'
18+
STACKQL_CORE_REPOSITORY: ${{ vars.STACKQL_CORE_REPOSITORY != '' && vars.STACKQL_CORE_REPOSITORY || 'stackql/stackql' }}
19+
STACKQL_CORE_REF: ${{ vars.STACKQL_CORE_REF != '' && vars.STACKQL_CORE_REF || 'main' }}
20+
STACKQL_ANY_SDK_REPOSITORY: ${{ vars.STACKQL_ANY_SDK_REPOSITORY != '' && vars.STACKQL_ANY_SDK_REPOSITORY || 'stackql/any-sdk' }}
21+
STACKQL_ANY_SDK_REF: ${{ vars.STACKQL_ANY_SDK_REF != '' && vars.STACKQL_ANY_SDK_REF || 'main' }}
22+
23+
jobs:
24+
25+
aot-testing:
26+
name: aot-testing
27+
runs-on: ubuntu-latest
28+
timeout-minutes: ${{ vars.DEFAULT_JOB_TIMEOUT_MIN == '' && 120 || vars.DEFAULT_JOB_TIMEOUT_MIN }}
29+
permissions:
30+
id-token: write
31+
contents: read
32+
env:
33+
AWS_DEFAULT_REGION: us-west-1
34+
REG_MAX_VERSIONS: 3
35+
REG_MAX_AGE_MONTHS: 6
36+
REG_WEBSITE_DIR: _deno_website
37+
REG_PROVIDER_PATH: providers/dist
38+
REG_ARTIFACT_REPO_BUCKET: stackql-registry-artifacts
39+
REG_DENO_DEPLOY_ASSET_REPO: deno-deploy-registry
40+
REG_DENO_DEPLOY_API_DEV: stackql-dev-registry
41+
REG_DENO_DEPLOY_API_PROD: stackql-registry
42+
43+
steps:
44+
- uses: actions/[email protected]
45+
name: "[SETUP] checkout repo"
46+
with:
47+
fetch-depth: 0
48+
49+
- name: Set up Go 1.x
50+
uses: actions/[email protected]
51+
with:
52+
go-version: ${{ env.GO_VERSION }}
53+
check-latest: true
54+
cache: true
55+
id: go
56+
57+
- name: Download core
58+
uses: actions/[email protected]
59+
with:
60+
repository: ${{ env.STACKQL_CORE_REPOSITORY }}
61+
ref: ${{ env.STACKQL_CORE_REF }}
62+
token: ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
63+
path: stackql-core
64+
65+
- name: Download any-sdk
66+
uses: actions/[email protected]
67+
with:
68+
repository: ${{ env.STACKQL_ANY_SDK_REPOSITORY }}
69+
ref: ${{ env.STACKQL_ANY_SDK_REF }}
70+
token: ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
71+
path: stackql-any-sdk
72+
73+
- name: Setup Python
74+
uses: actions/[email protected]
75+
with:
76+
python-version: '3.12'
77+
78+
- name: Add dependencies
79+
working-directory: stackql-core
80+
run: |
81+
sudo apt-get install -y jq
82+
pip3 install -r cicd/requirements.txt
83+
84+
- name: Build stackql from core source
85+
working-directory: stackql-core
86+
run: |
87+
go get ./...
88+
python3 cicd/python/build.py --build
89+
90+
- name: Build any-sdk cli from source
91+
working-directory: stackql-any-sdk
92+
run: |
93+
94+
go get ./...
95+
96+
go build -x -v \
97+
-o build/anysdk ./cmd/interrogate
98+
99+
- name: Run any-sdk cli AOT provider analysis
100+
run: |
101+
rc='0'
102+
for sd in ./providers/src/*/ ; do
103+
echo ""
104+
subdir="$(realpath "${sd}")"
105+
providerID="$(basename "${subdir}")"
106+
echo "Processing provider '${providerID}' at subdirectory: '${subdir}'" 1>&2
107+
echo ""
108+
./scripts/cicd/shell/aot-analysis/01-aot-analysis-compact.sh ${{ github.workspace }}/stackql-any-sdk/build/anysdk "${providerID}" "${subdir}/v00.00.00000/provider.yaml" &
109+
echo ""
110+
done
111+
echo ""
112+
echo "All tasks initiated. Waiting for them to complete..."
113+
# wait for all background jobs to finish
114+
wait
115+
echo ""
116+
echo "All tasks completed."
117+
echo ""
118+
for logFile in ./test/log/*.log ; do
119+
echo ""
120+
echo "contents of ${logFile}:"
121+
echo ""
122+
cat "${logFile}"
123+
echo ""
124+
done
125+
for rcf in ./test/log/rc_* ; do
126+
thisrc="$(cat "${rcf}")"
127+
if [ "$thisrc" != "0" ]; then
128+
echo "AOT analysis failure detected for: '${rcf}'" 1>&2
129+
rc='1'
130+
fi
131+
done
132+
if [ "$rc" -ne "0" ]; then
133+
echo "overall anysdk CLI AOT provider analysis failed" 1>&2
134+
exit 1
135+
else
136+
echo "overall anysdk CLI AOT provider analysis succeeded" 1>&2
137+
fi
138+
139+
- name: Upload AOT analysis logs
140+
uses: actions/[email protected]
141+
if: success()
142+
with:
143+
name: aot_analysis_logs
144+
path: ./test/log

.github/workflows/regression.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
env:
1818
IS_TAG: ${{ github.ref_type == 'tag' }}
19-
GO_VERSION: '^1.22'
19+
GO_VERSION: '~1.22'
2020
STACKQL_CORE_REPOSITORY: ${{ vars.STACKQL_CORE_REPOSITORY != '' && vars.STACKQL_CORE_REPOSITORY || 'stackql/stackql' }}
2121
STACKQL_CORE_REF: ${{ vars.STACKQL_CORE_REF != '' && vars.STACKQL_CORE_REF || 'main' }}
2222
STACKQL_ANY_SDK_REPOSITORY: ${{ vars.STACKQL_ANY_SDK_REPOSITORY != '' && vars.STACKQL_ANY_SDK_REPOSITORY || 'stackql/any-sdk' }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
CUR_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4+
5+
REPOSITORY_ROOT="$(realpath "${CUR_DIR}/../../../..")"
6+
7+
anySdkExe="${1}"
8+
9+
providerID="${2}"
10+
11+
providerRootFile="${3}"
12+
13+
logDir="${REPOSITORY_ROOT}/test/log"
14+
15+
registryDir="${REPOSITORY_ROOT}/providers"
16+
17+
${anySdkExe} aot "${registryDir}" "${providerRootFile}" -v > "${logDir}/aot_${providerID}.log" 2>&1
18+
19+
rc="$?"
20+
21+
echo "${rc}" > "${logDir}/rc_aot_${providerID}.txt"

test/log/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)