1+ name : Integration Testing and Analysis
2+
3+ on :
4+ push :
5+ tags :
6+ - robot*
7+ - regression*
8+ - integration*
9+
10+ env :
11+ GO_VERSION : ' ^1.22'
12+ STACKQL_CORE_REPOSITORY : ${{ vars.STACKQL_CORE_REPOSITORY != '' && vars.STACKQL_CORE_REPOSITORY || 'stackql/stackql' }}
13+ STACKQL_CORE_REF : ${{ vars.STACKQL_CORE_REF != '' && vars.STACKQL_CORE_REF || 'main' }}
14+ STACKQL_ANY_SDK_REPOSITORY : ${{ vars.STACKQL_ANY_SDK_REPOSITORY != '' && vars.STACKQL_ANY_SDK_REPOSITORY || 'stackql/any-sdk' }}
15+ STACKQL_ANY_SDK_REF : ${{ vars.STACKQL_ANY_SDK_REF != '' && vars.STACKQL_ANY_SDK_REF || 'main' }}
16+
17+ jobs :
18+ build-and-deploy :
19+ name : build-and-deploy
20+ runs-on : ubuntu-latest
21+ permissions :
22+ id-token : write
23+ contents : read
24+ env :
25+ AWS_DEFAULT_REGION : us-west-1
26+ REG_MAX_VERSIONS : 3
27+ REG_MAX_AGE_MONTHS : 6
28+ REG_WEBSITE_DIR : _deno_website
29+ REG_PROVIDER_PATH : providers/dist
30+ REG_ARTIFACT_REPO_BUCKET : stackql-registry-artifacts
31+ REG_DENO_DEPLOY_ASSET_REPO : deno-deploy-registry
32+ REG_DENO_DEPLOY_API_DEV : stackql-dev-registry
33+ REG_DENO_DEPLOY_API_PROD : stackql-registry
34+
35+ steps :
36+ 37+ name : " [SETUP] checkout repo"
38+ with :
39+ fetch-depth : 0
40+
41+ - name : Set up Go 1.x
42+ 43+ with :
44+ go-version : ${{ env.GO_VERSION }}
45+ check-latest : true
46+ cache : true
47+ id : go
48+
49+ - name : Download core
50+ 51+ with :
52+ repository : ${{ env.STACKQL_CORE_REPOSITORY }}
53+ ref : ${{ env.STACKQL_CORE_REF }}
54+ token : ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
55+ path : stackql-core
56+
57+ - name : Download any-sdk
58+ 59+ with :
60+ repository : ${{ env.STACKQL_ANY_SDK_REPOSITORY }}
61+ ref : ${{ env.STACKQL_ANY_SDK_REF }}
62+ token : ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
63+ path : stackql-any-sdk
64+
65+ - name : Setup Python
66+ 67+ with :
68+ python-version : ' 3.11'
69+
70+ - name : Add dependencies
71+ working-directory : stackql-core
72+ run : |
73+ sudo apt-get install -y jq
74+ pip3 install -r cicd/requirements.txt
75+
76+ - name : Build stackql from core source
77+ working-directory : stackql-core
78+ run : |
79+ go get ./...
80+ python3 cicd/python/build.py --build
81+
82+ - name : Parse tag
83+ id : parse_tag
84+ run : |
85+ tag_obj="$(python3 stackql-core/cicd/python/tag_parse.py '${{ github.ref_name }}' --parse-registry-tag)"
86+ echo "tag_obj: $tag_obj"
87+ {
88+ echo "PARSED_TAG_IS_ROBOT=$(echo $tag_obj | jq -r '.is_robot')"
89+ echo "PARSED_TAG_IS_REGRESSION=$(echo $tag_obj | jq -r '.is_regression')"
90+ } | tee -a "$GITHUB_ENV"
91+
92+
93+ - name : Prepare load balancing materials
94+ working-directory : stackql-core
95+ run : |
96+ python3 test/python/tcp_lb.py --generate-hosts-entries | sudo tee -a /etc/hosts
97+ python3 test/python/tcp_lb.py --generate-nginx-lb > test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf
98+
99+
100+ - name : Install and run nginx load balancer
101+ working-directory : stackql-core
102+ run : |
103+ sudo apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
104+ curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
105+ | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
106+ gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
107+ echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
108+ http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \
109+ | sudo tee /etc/apt/sources.list.d/nginx.list
110+ sudo apt-get update
111+ sudo apt-get install nginx
112+ sudo nginx -c "$(pwd)/test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf"
113+
114+ - name : Create materials for core tests
115+ working-directory : stackql-core
116+ run : |
117+ openssl req -x509 -keyout test/server/mtls/credentials/pg_server_key.pem -out test/server/mtls/credentials/pg_server_cert.pem -config test/server/mtls/openssl.cnf -days 365
118+ openssl req -x509 -keyout test/server/mtls/credentials/pg_client_key.pem -out test/server/mtls/credentials/pg_client_cert.pem -config test/server/mtls/openssl.cnf -days 365
119+ openssl req -x509 -keyout test/server/mtls/credentials/pg_rubbish_key.pem -out test/server/mtls/credentials/pg_rubbish_cert.pem -config test/server/mtls/openssl.cnf -days 365
120+
121+ - name : Run core robot functional tests
122+ if : success()
123+ working-directory : stackql-core
124+ run : |
125+ providerRoot="$(realpath $(pwd)/../providers)"
126+ sundryCfg='SUNDRY_CONFIG:{"registry_path": "'"${providerRoot}"'"}'
127+ robot \
128+ --variable "${sundryCfg}" \
129+ --variable SHOULD_RUN_DOCKER_EXTERNAL_TESTS:true \
130+ --include registry \
131+ -d test/robot/reports \
132+ test/robot/functional
133+
134+ - name : Output from functional tests
135+ if : always()
136+ run : |
137+ cat stackql-core/test/robot/reports/output.xml
138+
139+
0 commit comments