Nightly #766
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Nightly" | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
Run-Unit-TEST-In-Cython: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: dongtai/dongtai-mysql-unittest:latest | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping --silent" | |
--health-interval 10s | |
--health-timeout 180s | |
--health-retries 10 | |
redis: | |
image: dongtai/dongtai-redis:latest | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: ./.github/actions/setup-python | |
- name: Install dependencies | |
run: pip install coverage | |
- name: Django Unit Testing | |
run: | | |
export CELERY_EAGER_TEST=TRUE | |
cp dongtai_conf/conf/config.ini.test dongtai_conf/conf/config.ini | |
mkdir -p /tmp/logstash/report/{img,word,pdf,excel} && mkdir -p /tmp/iast_cache/package && mkdir -p /tmp/logstash/batchagent | |
python3 ./deploy/docker/version_update.py || true | |
python3 manage.py migrate | |
pip install Cython==3.0.0 | |
python setup.py build_ext --inplace | |
find . -name "*.so" | grep test | xargs rm | |
coverage run --source='.' manage.py test | |
coverage report | |
Run-API-TEST-With-Cython: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: dongtai/dongtai-mysql-unittest:latest | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping --silent" | |
--health-interval 10s | |
--health-timeout 180s | |
--health-retries 10 | |
redis: | |
image: dongtai/dongtai-redis:latest | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: ./.github/actions/setup-python | |
- name: Install dependencies | |
run: | | |
pip install schemathesis | |
pip install httpx | |
- name: Django Api Testing | |
run: | | |
mysql --host=127.0.0.1 -uroot -p'dongtai-iast' -D dongtai_webapi < /home/runner/work/DongTai/DongTai/test/init.sql | |
cp dongtai_conf/conf/config.ini.test dongtai_conf/conf/config.ini | |
export DOC=TRUE | |
mkdir -p /tmp/logstash/report/{img,word,pdf,excel} && mkdir -p /tmp/iast_cache/package && mkdir -p /tmp/logstash/batchagent | |
python3 ./deploy/docker/version_update.py || true | |
python3 manage.py migrate | |
pip install Cython==3.0.0 | |
python setup.py build_ext --inplace | |
python setup.py build_ext --inplace | |
python3 manage.py runserver 0.0.0.0:8000 > webapi.log & | |
sleep 15 | |
schemathesis run --rate-limit=28/s --base-url "http://localhost:8000/" -H 'Authorization: Token 67aebd78e700ad36a82a152276196b5f49fafeb0' http://localhost:8000/api/XZPcGFKoxYXScwGjQtJx8u/schema/ --hypothesis-suppress-health-check=data_too_large,filter_too_much,too_slow,large_base_example --validate-schema=false --hypothesis-verbosity normal | |
Run-BuildCheck: | |
if: ${{ github.repository_owner == 'HXSecurity' }} | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
arch: ["linux/amd64", "linux/arm64"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build and push ${{ matrix.arch }} | |
uses: docker/build-push-action@v2 | |
with: | |
file: Dockerfile | |
context: . | |
# push: True | |
platforms: ${{ matrix.arch }} | |
tags: | | |
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-server-test:latest | |
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-server-test:1.0.${{github.run_number}} |