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