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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ updates:
default-days: 7
semver-major-days: 14

- package-ecosystem: "github-actions"
directory: "/"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
schedule:
interval: "daily"
cooldown:
default-days: 7

- package-ecosystem: "cargo"
directory: "/pycrockford_rs"
open-pull-requests-limit: 5
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
lint-test:
runs-on: ubuntu-latest
env:
CS_ACCESS_TOKEN: ${{ secrets.CS_ACCESS_TOKEN }}
CODESCENE_CLI_SHA256: ${{ vars.CODESCENE_CLI_SHA256 }}

WHITAKER_INSTALLER_VERSION: '0.2.5'
CARGO_TERM_COLOR: always
BUILD_PROFILE: debug

steps:
- name: Check out repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: '3.13'

- name: Install uv
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5

- name: Set up Rust
uses: leynos/shared-actions/.github/actions/setup-rust@455d9ed03477c0026da96c2541ca26569a74acac
with:
toolchain: stable

- name: Cache Rust lint and test tools
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
with:
cache-directories: |
~/.cargo/bin/cargo-nextest
~/.cargo/bin/cargo-audit
~/.cargo/bin/whitaker-installer
~/.local/bin/whitaker
~/.local/share/whitaker

- name: Install Rust lint and test tools
env:
RUSTFLAGS: ""
run: |
if ! command -v whitaker-installer >/dev/null 2>&1; then
if cargo binstall --version >/dev/null 2>&1; then
cargo binstall --no-confirm --locked \
whitaker-installer@"${WHITAKER_INSTALLER_VERSION}"
else
echo "cargo-binstall unavailable; building whitaker-installer from crates.io"
cargo install --locked \
whitaker-installer --version "${WHITAKER_INSTALLER_VERSION}"
fi
fi
whitaker-installer --cranelift
cargo install --locked cargo-audit

- name: Install CLI tools
run: |
for tool in mbake; do uv tool install ${tool}; done
npm install -g markdownlint-cli2

- name: Validate Makefile
run: mbake validate Makefile

- name: Install code
run: make build

- name: Check formatting
run: make check-fmt

- name: Run ruff
run: make lint

- name: Run typechecker
run: make typecheck

- name: Audit dependencies
run: make audit

- name: Test and Measure Coverage
uses: leynos/shared-actions/.github/actions/generate-coverage@455d9ed03477c0026da96c2541ca26569a74acac
with:
output-path: coverage.xml
format: cobertura
artefact-name-suffix: msgspec-crockford

cargo-manifest: pycrockford_rs/Cargo.toml

- name: Install CodeScene Coverage CLI
if: env.CS_ACCESS_TOKEN != ''
run: |
curl -fsSL --output install-cs-coverage-tool.sh \
https://downloads.codescene.io/enterprise/cli/install-cs-coverage-tool.sh
if [ -n "${CODESCENE_CLI_SHA256:-}" ]; then
echo "${CODESCENE_CLI_SHA256} install-cs-coverage-tool.sh" | sha256sum -c -
else
echo "::notice::CODESCENE_CLI_SHA256 is not set; skipping installer checksum verification"
fi
bash install-cs-coverage-tool.sh -y

- name: Upload coverage to CodeScene
if: env.CS_ACCESS_TOKEN != ''
run: |
if [ ! -f coverage.xml ]; then
echo "coverage.xml not found!"
exit 1
fi
cs-coverage upload \
--format "cobertura" \
--metric "line-coverage" \
coverage.xml
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,7 @@ target/
# Generated by cargo mutants
# Contains mutation testing data
**/mutants.out*/

# uv tooling caches used by the Makefile
.uv-cache/
.uv-tools/
22 changes: 22 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"config": {
"MD004": { "style": "dash" },
"MD010": { "code_blocks": false },
"MD013": {
"line_length": 80,
"code_block_line_length": 120,
"tables": false,
"headings": false
},
"MD029": { "style": "ordered" }
},
"ignores": [
"**/.venv/**",
".node_modules/**",
"**/node_modules/**",
"**/target/**",
".terraform/**",
".uv-cache/**",
"CRUSH.md"
]
}
Loading
Loading