-
Notifications
You must be signed in to change notification settings - Fork 0
Add CI/CD workflows matching GNAT #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: DCO Check | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| dco: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: tim-actions/dco@master | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,21 @@ | ||||||||||||||||||||||||||||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||||||||||||||||||||||||||||
| # Copyright 2026 Bill Halpin | ||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||
| name: Dependency Review | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| pip-audit: | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - name: Check out code | ||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||
| - name: Run pip-audit | ||||||||||||||||||||||||||||||||
| uses: pypa/gh-action-pip-audit@v1.1.0 | ||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||
| inputs: "." | ||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+21
|
||||||||||||||||||||||||||||||||
| - name: Run pip-audit | |
| uses: pypa/gh-action-pip-audit@v1.1.0 | |
| with: | |
| inputs: "." | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install pip-audit and project dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pip-audit | |
| python -m pip install -e . | |
| - name: Run pip-audit | |
| run: python -m pip_audit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: Pylint | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.11", "3.12"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pylint | ||
| pip install -e ".[dev]" | ||
| - name: Analysing the code with pylint | ||
| run: pylint redgnat/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: Python Fast Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: python-fast-lint-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| ruff: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| - name: Run Ruff | ||
| uses: astral-sh/ruff-action@v3 | ||
| with: | ||
| args: check . | ||
| - name: Check formatting | ||
| uses: astral-sh/ruff-action@v3 | ||
| with: | ||
| args: format --check . |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||||||||||||||||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||||||||||||||||||||||||||
| # Copyright 2026 Bill Halpin | ||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||
| name: Python Security | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||
| - cron: "23 4 * * 1" # Mondays at 04:23 UTC | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||
| group: python-security-${{ github.ref }} | ||||||||||||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||
| bandit: | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - name: Check out code | ||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||||
| uses: actions/setup-python@v5 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| python-version: "3.11" | ||||||||||||||||||||||||||||||
| - name: Install Bandit | ||||||||||||||||||||||||||||||
| run: pip install bandit | ||||||||||||||||||||||||||||||
| - name: Run Bandit | ||||||||||||||||||||||||||||||
| run: bandit -r redgnat/ -ll -x tests/ | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| pip-audit: | ||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||
| - name: Check out code | ||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||
| - name: Run pip-audit | ||||||||||||||||||||||||||||||
| uses: pypa/gh-action-pip-audit@v1.1.0 | ||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||
| inputs: "." | ||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
+44
|
||||||||||||||||||||||||||||||
| - name: Run pip-audit | |
| uses: pypa/gh-action-pip-audit@v1.1.0 | |
| with: | |
| inputs: "." | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install pip-audit | |
| run: pip install pip-audit | |
| - name: Install project dependencies | |
| run: pip install -e . | |
| - name: Run pip-audit | |
| run: pip-audit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: Python Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: python-tests-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.11", "3.12"] | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: pip | ||
| - name: Upgrade pip | ||
| run: python -m pip install --upgrade pip | ||
| - name: Install package and test deps | ||
| run: pip install -e ".[dev]" | ||
| - name: Run tests | ||
| run: pytest -q |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: Python Type Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: python-typecheck-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| mypy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11" | ||
| cache: pip | ||
| - name: Upgrade pip | ||
| run: python -m pip install --upgrade pip | ||
| - name: Install package and type deps | ||
| run: pip install -e ".[dev]" | ||
| - name: Run mypy | ||
| run: mypy redgnat/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: Security Hygiene | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "redgnat/techniques/**" | ||
| - "redgnat/engagement/**" | ||
| - "tests/unit/techniques/**" | ||
| - "tests/unit/engagement/**" | ||
| - ".github/workflows/security-hygiene.yml" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| hygiene: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e ".[dev]" | ||
| - name: Run technique and engagement tests | ||
| run: pytest tests/unit/techniques/ tests/unit/engagement/ -q |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2026 Bill Halpin | ||
| --- | ||
| name: Semgrep | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: "11 5 * * 3" # Wednesdays at 05:11 UTC | ||
|
|
||
| jobs: | ||
| semgrep: | ||
| name: Semgrep SAST | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| - name: Run Semgrep | ||
| uses: returntocorp/semgrep-action@v1 | ||
| with: | ||
| config: >- | ||
| p/python | ||
| p/security-audit | ||
| p/secrets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tim-actions/dcois referenced via@master, which is an unpinned floating ref. Pin this action to a specific release tag or (preferably) a commit SHA to avoid supply-chain risk and unexpected behavior changes.