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
5 changes: 5 additions & 0 deletions .github/actions/setup-docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description: >-
preview, and stable workflows.

inputs:
enable-qemu:
description: "Set up QEMU for multi-platform builds"
required: false
default: "true"
dockerhub-username:
description: "Docker Hub username (pass from secrets)"
required: true
Expand All @@ -16,6 +20,7 @@ runs:
using: "composite"
steps:
- uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
if: inputs.enable-qemu == 'true'
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ jobs:
persist-credentials: false

- name: Build the Dockerfile (no push)
run: docker build --pull -t socket-python-cli:dependabot-smoke .
run: >-
docker build --pull
--build-arg USE_LOCAL_INSTALL=true
-t socket-python-cli:dependabot-smoke .
workflow-notice:
needs: inspect
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/package-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Package Check

on:
pull_request:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

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

jobs:
package-check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"

- name: Install build tooling
uses: ./.github/actions/setup-hatch

- name: Install distribution validator
run: python -m pip install "twine>=4.0.0"

- name: Build distributions
run: hatch build

- name: Validate distributions
run: python -m twine check dist/*

- name: Install and inspect wheel without resolving dependencies
run: |
python -m venv "$RUNNER_TEMP/package-check"
"$RUNNER_TEMP/package-check/bin/pip" install --no-deps dist/*.whl
"$RUNNER_TEMP/package-check/bin/python" - <<'PY'
import compileall
import importlib.metadata
import pathlib
import sysconfig

distribution = importlib.metadata.distribution("socketsecurity")
entry_points = {entry_point.name for entry_point in distribution.entry_points}
assert "socketcli" in entry_points
package = pathlib.Path(sysconfig.get_paths()["purelib"]) / "socketsecurity"
assert compileall.compile_dir(package, quiet=1)
print("wheel metadata and bytecode smoke OK", distribution.version)
PY

- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socketsecurity-${{ github.sha }}
path: dist/*
if-no-files-found: error
retention-days: 14
Loading