Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
549d575653 | ||
|
|
c3189d83b7 | ||
|
|
b22e6e6abb | ||
|
|
59346dc2d5 |
No files matched your search
@@ -16,10 +16,15 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
python_only:
|
||||||
|
description: Narrow CI-06 Python job rerun after a proven runner setup failure
|
||||||
|
required: false
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
node-regression:
|
node-regression:
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.quality_only != 'true' }}
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.quality_only != 'true' && (github.event_name != 'workflow_dispatch' || github.event.inputs.python_only != 'true') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
@@ -52,25 +57,36 @@ jobs:
|
|||||||
python-regression:
|
python-regression:
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.p01_only != 'true' }}
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.p01_only != 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
container: node:22-bookworm-slim
|
||||||
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Install Bookworm Python and checkout prerequisites
|
||||||
with:
|
|
||||||
github-server-url: https://dev.ivib.cc
|
|
||||||
- name: Install Python toolchain
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -y python3 python3-venv python3-pip
|
apt-get install -y --no-install-recommends git ca-certificates python3 python3-venv python3-pip
|
||||||
python3 -m venv /tmp/datastack-ci-venv
|
- uses: actions/checkout@v4
|
||||||
/tmp/datastack-ci-venv/bin/python -m pip install -e ./sdk/python/datastack -e ./sdk-python
|
with:
|
||||||
- name: Run all Python SDK tests
|
github-server-url: https://dev.ivib.cc
|
||||||
|
- name: CI-06 Python 3.11 isolated virtual environment
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
/tmp/datastack-ci-venv/bin/python -m compileall -q ./sdk/python/datastack ./sdk-python
|
python3 --version
|
||||||
/tmp/datastack-ci-venv/bin/python -m unittest discover -s tests -p '*_test.py' -v
|
python3 -m venv /tmp/datastack-ci-venv
|
||||||
|
/tmp/datastack-ci-venv/bin/python -m pip install --disable-pip-version-check -e ./sdk/python/datastack -e ./sdk-python
|
||||||
|
- name: CI-06 compile and assert 14 Python SDK regressions
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
py=/tmp/datastack-ci-venv/bin/python
|
||||||
|
"$py" -m compileall -q ./sdk/python/datastack ./sdk-python
|
||||||
|
"$py" -m unittest discover -s tests -p '*_test.py' -v > /tmp/datastack-python-tests.log 2>&1 || { cat /tmp/datastack-python-tests.log; exit 1; }
|
||||||
|
cat /tmp/datastack-python-tests.log
|
||||||
|
grep -Eq '^Ran 14 tests in ' /tmp/datastack-python-tests.log
|
||||||
|
grep -Eq '^OK$' /tmp/datastack-python-tests.log
|
||||||
|
echo DATASTACK_PYTHON_14_OF_14_PASS
|
||||||
|
|
||||||
quality:
|
quality:
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.python_only != 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
@@ -85,7 +101,7 @@ jobs:
|
|||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
||||||
production-build:
|
production-build:
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.quality_only != 'true' }}
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.quality_only != 'true' && (github.event_name != 'workflow_dispatch' || github.event.inputs.python_only != 'true') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 25
|
timeout-minutes: 25
|
||||||
steps:
|
steps:
|
||||||
@@ -101,30 +117,45 @@ jobs:
|
|||||||
test -f .next/standalone/server.js
|
test -f .next/standalone/server.js
|
||||||
|
|
||||||
docker-image-build:
|
docker-image-build:
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.p01_only != 'true' }}
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.p01_only != 'true' && (github.event_name != 'workflow_dispatch' || github.event.inputs.python_only != 'true') }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 35
|
container: node:22-alpine
|
||||||
|
timeout-minutes: 45
|
||||||
steps:
|
steps:
|
||||||
|
- name: CI-07 provision Docker Buildx CLI
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
apk add --no-cache git docker-cli docker-cli-buildx docker-cli-compose
|
||||||
|
docker --version
|
||||||
|
docker buildx version
|
||||||
|
docker compose version
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
github-server-url: https://dev.ivib.cc
|
github-server-url: https://dev.ivib.cc
|
||||||
- name: Docker and Compose availability
|
- name: CI-07 inspect daemon and validate Compose without starting services
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
docker --version
|
docker info --format 'Driver={{.Driver}} Root={{.DockerRootDir}}'
|
||||||
docker compose version
|
df -h .
|
||||||
docker info
|
docker compose -f docker/docker-compose.yml config --no-interpolate --quiet
|
||||||
- name: Validate Compose structure
|
echo DATASTACK_COMPOSE_CONFIG_PASS
|
||||||
run: docker compose -f docker/docker-compose.yml config --no-interpolate --quiet
|
- name: CI-07 isolated BuildKit all three images (no deployment)
|
||||||
- name: Build Docker images without running services
|
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
docker build -f docker/Dockerfile.server -t datastack-ci-ingestion .
|
builder="datastack-p03-${GITHUB_RUN_ID:-0}-${GITHUB_RUN_ATTEMPT:-1}"
|
||||||
docker build -f docker/Dockerfile.web -t datastack-ci-web .
|
tag="datastack-p03-${GITHUB_SHA:-local}"
|
||||||
docker build -f docker/Dockerfile.proxy -t datastack-ci-proxy .
|
cleanup() { docker buildx rm --force "$builder" >/dev/null 2>&1 || true; }
|
||||||
|
trap cleanup EXIT
|
||||||
|
docker buildx create --name "$builder" --driver docker-container --use
|
||||||
|
docker buildx inspect "$builder" --bootstrap
|
||||||
|
docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.server -t "$tag-ingestion" .
|
||||||
|
docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.web -t "$tag-web" .
|
||||||
|
docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.proxy -t "$tag-proxy" .
|
||||||
|
docker image inspect "$tag-ingestion" "$tag-web" "$tag-proxy" >/dev/null
|
||||||
|
echo DATASTACK_THREE_IMAGES_BUILD_PASS
|
||||||
|
|
||||||
windows-compatibility:
|
windows-compatibility:
|
||||||
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.quality_only != 'true' }}
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.quality_only != 'true' && (github.event_name != 'workflow_dispatch' || github.event.inputs.python_only != 'true') }}
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
timeout-minutes: 25
|
timeout-minutes: 25
|
||||||
steps:
|
steps:
|
||||||
@@ -150,3 +181,43 @@ jobs:
|
|||||||
if ($LASTEXITCODE -ne 0) { throw 'SDK install failed' }
|
if ($LASTEXITCODE -ne 0) { throw 'SDK install failed' }
|
||||||
npm --prefix sdk/node/datastack run build
|
npm --prefix sdk/node/datastack run build
|
||||||
if ($LASTEXITCODE -ne 0) { throw 'SDK compilation failed' }
|
if ($LASTEXITCODE -ne 0) { throw 'SDK compilation failed' }
|
||||||
|
|
||||||
|
security-audit:
|
||||||
|
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.p01_only != 'true' && (github.event_name != 'workflow_dispatch' || github.event.inputs.python_only != 'true') }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: node:22-alpine
|
||||||
|
timeout-minutes: 15
|
||||||
|
steps:
|
||||||
|
- name: Install checkout prerequisite
|
||||||
|
run: apk add --no-cache git
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
github-server-url: https://dev.ivib.cc
|
||||||
|
- name: CI-08 read-only full and runtime npm advisory inventory
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
if npm audit --json > /tmp/datastack-audit-full.json; then :; else test "$?" -eq 1; fi
|
||||||
|
if npm audit --omit=dev --json > /tmp/datastack-audit-runtime.json; then :; else test "$?" -eq 1; fi
|
||||||
|
node <<'NODE'
|
||||||
|
const fs = require("node:fs");
|
||||||
|
for (const scope of ["full", "runtime"]) {
|
||||||
|
const audit = JSON.parse(fs.readFileSync("/tmp/datastack-audit-" + scope + ".json", "utf8"));
|
||||||
|
if (!audit.metadata || !audit.metadata.vulnerabilities || !audit.vulnerabilities) {
|
||||||
|
throw Error("Incomplete npm audit response for " + scope);
|
||||||
|
}
|
||||||
|
console.log("AUDIT_COUNTS " + scope + " " + JSON.stringify(audit.metadata.vulnerabilities));
|
||||||
|
for (const [name, item] of Object.entries(audit.vulnerabilities)) {
|
||||||
|
const advisories = (item.via || []).filter(v => typeof v === "object").map(v => ({
|
||||||
|
id: v.source, url: v.url, range: v.range, severity: v.severity
|
||||||
|
}));
|
||||||
|
console.log("AUDIT_PACKAGE " + scope + " " + JSON.stringify({
|
||||||
|
package: name, severity: item.severity, direct: item.isDirect,
|
||||||
|
range: item.range, via: advisories,
|
||||||
|
viaPackages: (item.via || []).filter(v => typeof v === "string"),
|
||||||
|
fixAvailable: item.fixAvailable
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NODE
|
||||||
|
git diff --exit-code -- package.json package-lock.json
|
||||||
|
echo DATASTACK_SECURITY_TRIAGE_INVENTORY_PASS
|
||||||
@@ -1,39 +1,41 @@
|
|||||||
name: DataStack Docker Build CI
|
name: DataStack Docker Build CI
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- '.gitea/workflows/datastack-docker-ci.yml'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-build:
|
docker-build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: node:22-alpine
|
container: node:22-alpine
|
||||||
timeout-minutes: 40
|
timeout-minutes: 45
|
||||||
steps:
|
steps:
|
||||||
- name: Provision isolated Docker CLI and Git tools
|
- name: CI-07 provision Docker Buildx CLI
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
apk add --no-cache git docker-cli docker-cli-compose
|
apk add --no-cache git docker-cli docker-cli-buildx docker-cli-compose
|
||||||
docker --version
|
docker --version
|
||||||
|
docker buildx version
|
||||||
docker compose version
|
docker compose version
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
github-server-url: https://dev.ivib.cc
|
github-server-url: https://dev.ivib.cc
|
||||||
- name: Validate actual Compose configuration
|
- name: CI-07 inspect daemon and validate Compose without starting services
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
|
docker info --format 'Driver={{.Driver}} Root={{.DockerRootDir}}'
|
||||||
|
df -h .
|
||||||
docker compose -f docker/docker-compose.yml config --no-interpolate --quiet
|
docker compose -f docker/docker-compose.yml config --no-interpolate --quiet
|
||||||
echo DATASTACK_COMPOSE_CONFIG_PASS
|
echo DATASTACK_COMPOSE_CONFIG_PASS
|
||||||
- name: Check CI-only Docker daemon
|
- name: CI-07 isolated BuildKit all three images (no deployment)
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
docker info >/dev/null || { echo DOCKER_DAEMON_UNAVAILABLE; exit 3; }
|
builder="datastack-p03-${GITHUB_RUN_ID:-0}-${GITHUB_RUN_ATTEMPT:-1}"
|
||||||
- name: Build all DataStack container images without deployment
|
tag="datastack-p03-${GITHUB_SHA:-local}"
|
||||||
run: |
|
cleanup() { docker buildx rm --force "$builder" >/dev/null 2>&1 || true; }
|
||||||
set -eu
|
trap cleanup EXIT
|
||||||
docker build -f docker/Dockerfile.server -t datastack-ci-ingestion .
|
docker buildx create --name "$builder" --driver docker-container --use
|
||||||
docker build -f docker/Dockerfile.web -t datastack-ci-web .
|
docker buildx inspect "$builder" --bootstrap
|
||||||
docker build -f docker/Dockerfile.proxy -t datastack-ci-proxy .
|
docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.server -t "$tag-ingestion" .
|
||||||
echo DATASTACK_DOCKER_IMAGES_PASS
|
docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.web -t "$tag-web" .
|
||||||
|
docker buildx build --builder "$builder" --progress=plain --no-cache --load -f docker/Dockerfile.proxy -t "$tag-proxy" .
|
||||||
|
docker image inspect "$tag-ingestion" "$tag-web" "$tag-proxy" >/dev/null
|
||||||
|
echo DATASTACK_THREE_IMAGES_BUILD_PASS
|
||||||
Reference in new issue
Block a user