Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@ name: CI
on:
push:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'BACKLOG.md'
- 'docs/**'
- '.gitignore'
- '.github/approved-actors.yml'
pull_request:
paths-ignore:
- '**.md'
- 'BACKLOG.md'
- 'docs/**'
- '.gitignore'
- '.github/approved-actors.yml'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -61,6 +77,13 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: false
- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install coverage
- name: Run Python unit tests with coverage
Expand Down
45 changes: 27 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ permissions:
contents: write
packages: write

# Local/CI parity: lint and build are containerized (linter + winbuild Dockerfiles).
# Both local and CI run the same images with the same pinned tool versions.
# The dockerfiles-drycheck.sh step below validates Dockerfile structure.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -21,28 +28,28 @@ jobs:
- name: Create artifacts directory
run: mkdir -p artifacts

- name: Cache Trivy binary
uses: actions/cache@v4
with:
path: /tmp/trivy.deb
key: ${{ runner.os }}-trivy-0.59.1

- name: Install Trivy (for image scanning)
run: |
curl -sSL -o /tmp/trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.59.1/trivy_0.59.1_Linux-64bit.deb
if [[ -f /tmp/trivy.deb ]]; then
echo "Using cached trivy binary"
else
curl -sSL -o /tmp/trivy.deb https://github.com/aquasecurity/trivy/releases/download/v0.59.1/trivy_0.59.1_Linux-64bit.deb
fi
sudo dpkg -i /tmp/trivy.deb
rm /tmp/trivy.deb

- name: Run all tests (containerized)
run: |
export WBAB_ALLOW_LOCAL_BUILD=1

# Set executable bits before changing ownership
chmod +x scripts/lint.sh scripts/lint-container.sh tests/shell/run.sh tests/contract/run.sh tests/policy/run.sh tests/e2e/run.sh

# Fix permissions for non-root containers (UID 1000)
sudo chmod -R a+w .

./scripts/lint.sh
./tests/shell/run.sh
./tests/contract/run.sh
./tests/policy/run.sh
./tests/e2e/run.sh
- name: Cache Trivy vulnerability DB
uses: actions/cache@v4
with:
path: ~/.cache/trivy
key: ${{ runner.os }}-trivy-db

# Tests already passed in ci.yml on merge — release only validates publish
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand Down Expand Up @@ -85,6 +92,8 @@ jobs:
--file "${dockerfile}" \
--tag "${image}:${TAG}" \
--tag "${image}:latest" \
--cache-from type=gha \
--cache-to type=gha,mode=max \
--label "org.opencontainers.image.source=https://github.com/${REPO}" \
--label "org.opencontainers.image.revision=${SHA}" \
--label "org.opencontainers.image.version=${TAG}" \
Expand All @@ -104,7 +113,7 @@ jobs:

# Scan the published image for vulnerabilities
echo "Scanning ${image}:${TAG} for vulnerabilities..."
trivy image --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 "${image}:${TAG}" || {
trivy image --cache-dir ~/.cache/trivy --severity HIGH,CRITICAL --ignore-unfixed --exit-code 1 "${image}:${TAG}" || {
echo "ERROR: High/Critical vulnerabilities found in ${image}:${TAG}" >&2
exit 1
}
Expand Down
Loading