1+ name : Integration Testing and Analysis
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ - develop
8+ - version*
9+ push :
10+ branches :
11+ - main
12+ - develop
13+ - version*
14+ tags :
15+ - robot*
16+ - regression*
17+ - integration*
18+
19+ env :
20+ GO_VERSION : ' ^1.22'
21+ STACKQL_CORE_REPOSITORY : ${{ vars.STACKQL_CORE_REPOSITORY != '' && vars.STACKQL_CORE_REPOSITORY || 'stackql/stackql' }}
22+ STACKQL_CORE_REF : ${{ vars.STACKQL_CORE_REF != '' && vars.STACKQL_CORE_REF || 'main' }}
23+ STACKQL_ANY_SDK_REPOSITORY : ${{ vars.STACKQL_ANY_SDK_REPOSITORY != '' && vars.STACKQL_ANY_SDK_REPOSITORY || 'stackql/any-sdk' }}
24+ STACKQL_ANY_SDK_REF : ${{ vars.STACKQL_ANY_SDK_REF != '' && vars.STACKQL_ANY_SDK_REF || 'main' }}
25+
26+ jobs :
27+ build-and-deploy :
28+ name : build-and-deploy
29+ runs-on : ubuntu-latest
30+ permissions :
31+ id-token : write
32+ contents : read
33+ env :
34+ AWS_DEFAULT_REGION : us-west-1
35+ REG_MAX_VERSIONS : 3
36+ REG_MAX_AGE_MONTHS : 6
37+ REG_WEBSITE_DIR : _deno_website
38+ REG_PROVIDER_PATH : providers/dist
39+ REG_ARTIFACT_REPO_BUCKET : stackql-registry-artifacts
40+ REG_DENO_DEPLOY_ASSET_REPO : deno-deploy-registry
41+ REG_DENO_DEPLOY_API_DEV : stackql-dev-registry
42+ REG_DENO_DEPLOY_API_PROD : stackql-registry
43+
44+ steps :
45+ - uses : actions/checkout@v4.1.1
46+ name : " [SETUP] checkout repo"
47+ with :
48+ fetch-depth : 0
49+
50+ - name : Set up Go
51+ uses : actions/setup-go@v5.0.0
52+ with :
53+ go-version : ${{ env.GO_VERSION }}
54+ check-latest : true
55+ cache : true
56+ id : go
57+
58+ - name : Build rust release artifact
59+ if : success()
60+ run : |
61+ cargo build --release --bin client_test_harness
62+
63+ - name : Download core
64+ uses : actions/checkout@v4.1.1
65+ with :
66+ repository : ${{ env.STACKQL_CORE_REPOSITORY }}
67+ ref : ${{ env.STACKQL_CORE_REF }}
68+ token : ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
69+ path : stackql-core
70+
71+ - name : Download any-sdk
72+ uses : actions/checkout@v4.1.1
73+ with :
74+ repository : ${{ env.STACKQL_ANY_SDK_REPOSITORY }}
75+ ref : ${{ env.STACKQL_ANY_SDK_REF }}
76+ token : ${{ secrets.CI_STACKQL_PACKAGE_DOWNLOAD_TOKEN }}
77+ path : stackql-any-sdk
78+
79+ - name : Setup Python
80+ uses : actions/setup-python@v5.0.0
81+ with :
82+ python-version : ' 3.11'
83+
84+ - name : Add dependencies
85+ working-directory : stackql-core
86+ run : |
87+ sudo apt-get install -y jq
88+ pip3 install -r cicd/requirements.txt
89+
90+ - name : Build stackql from core source
91+ working-directory : stackql-core
92+ run : |
93+ go get ./...
94+ python3 cicd/python/build.py --build
95+
96+ - name : Generate rewritten registry for simulations
97+ working-directory : stackql-core
98+ run : |
99+ python3 test/python/registry-rewrite.py
100+
101+
102+ - name : Prepare load balancing materials
103+ working-directory : stackql-core
104+ run : |
105+ sudo cp /etc/hosts /etc/hosts.bak
106+ python3 test/python/tcp_lb.py --generate-hosts-entries | sudo tee -a /etc/hosts
107+ python3 test/python/tcp_lb.py --generate-nginx-lb > test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf
108+
109+
110+ - name : Install and run nginx load balancer
111+ working-directory : stackql-core
112+ run : |
113+ sudo apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
114+ curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
115+ | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
116+ gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
117+ echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
118+ http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \
119+ | sudo tee /etc/apt/sources.list.d/nginx.list
120+ sudo apt-get update
121+ sudo apt-get install nginx
122+ sudo nginx -c "$(pwd)/test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf"
123+
124+ - name : Create materials for core tests
125+ working-directory : stackql-core
126+ run : |
127+ 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
128+ 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
129+ 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
130+
131+ - name : Start Core Test Mocks
132+ working-directory : stackql-core
133+ run : |
134+ pgrep -f flask | xargs kill -9 || true
135+ flask --app=./test/python/flask/github/app run --cert=./test/server/mtls/credentials/pg_server_cert.pem --key=./test/server/mtls/credentials/pg_server_key.pem --host 0.0.0.0 --port 1093 &
136+
137+ - name : Run core robot functional tests
138+ if : success()
139+ run : |
140+ providerRoot="$(realpath $(pwd)/stackql-core/test/registry-mocked)"
141+ sundryCfg='SUNDRY_CONFIG:{"registry_path": "'"${providerRoot}"'"}'
142+ robot \
143+ --variable "${sundryCfg}" \
144+ --variable SHOULD_RUN_DOCKER_EXTERNAL_TESTS:true \
145+ -d test/robot/reports \
146+ test/robot/functional
147+
148+ - name : Output from functional tests
149+ if : always()
150+ run : |
151+ cat test/robot/reports/output.xml
152+
153+ - name : Post core test cleanup
154+ if : always()
155+ run : |
156+ pgrep -f flask | xargs kill -9 || true
157+
0 commit comments