Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dcb8c43
build(flake): use PYTHON_VERSION
drainpixie Sep 2, 2025
0ca6317
style(flake): format forAllSystems
drainpixie Sep 2, 2025
6207e27
ci(test-lint): initialise nixification
drainpixie Sep 2, 2025
92eb57e
ci: testing hooks
drainpixie Sep 2, 2025
3a05cb4
fix: prefer yaml over shell branches
drainpixie Sep 2, 2025
4a23836
chore: bump setup-uv
drainpixie Sep 2, 2025
b4e9a1e
fix: add test group to renderer
drainpixie Sep 2, 2025
f7b506b
ci: restore previous hooks
drainpixie Sep 2, 2025
e015ffc
chore(test-lint): doesn't benefit from cachix
drainpixie Sep 2, 2025
1d10010
Merge branch 'main' into ci/nix
drainpixie Sep 3, 2025
4b54eee
build: add wheel derivation
drainpixie Sep 3, 2025
09c4e43
build: switch to uv2nix
drainpixie Sep 4, 2025
92bb0ac
chore: add output to gitignore and tidy
drainpixie Sep 4, 2025
aeb5193
ci: bump actions/checkout to v5
drainpixie Sep 4, 2025
599beeb
ci: cd-publish action
drainpixie Sep 4, 2025
1c463ee
fix: incorrect workflow syntax
drainpixie Sep 4, 2025
7a0b0b8
fix: incorrect workflow syntax for lint
drainpixie Sep 4, 2025
0fe2242
build: pure devshell
drainpixie Sep 4, 2025
734d6e7
fix: devShell name, hooks packages, enabled groups
drainpixie Sep 4, 2025
2487ef4
ci: readd cachix for lint
drainpixie Sep 4, 2025
4d0472a
ci: get rid of push filter
drainpixie Sep 4, 2025
a39f44d
ci: hardcode cachix instance name
drainpixie Sep 4, 2025
c12f101
fix: yaml is a bad format
drainpixie Sep 4, 2025
a8fd894
ci: incorrect env mapping
drainpixie Sep 4, 2025
cb8c088
ci: bump actions/checkout to v5
drainpixie Sep 4, 2025
d11d964
ci: cachix name is amperser
drainpixie Sep 4, 2025
bf7deaa
ci: make nix build output full error
drainpixie Sep 4, 2025
3cb40b9
fix: set LC_ALL
drainpixie Sep 5, 2025
df3926f
revert: fix: set LC_ALL
drainpixie Sep 5, 2025
a20340a
style: format flake
drainpixie Sep 5, 2025
e770da1
ci: add changelog generation via cliff
drainpixie Sep 5, 2025
4ffa5b4
fix: wrong variable name
drainpixie Sep 5, 2025
09aaada
fix: env not available
drainpixie Sep 5, 2025
2cd6709
fix: wrong action name
drainpixie Sep 5, 2025
302de9d
ci: prefer devshell over cliff action
drainpixie Sep 5, 2025
e1ccb48
refactor: move changelog generation to build step
drainpixie Sep 5, 2025
1e34a84
fix: add depth to checkout
drainpixie Sep 5, 2025
28f21f8
ci: remove useless depth from build step
drainpixie Sep 5, 2025
60467eb
ci: run build on dispatch
drainpixie Sep 8, 2025
d8bbc96
ci: tidy + add workflow inputs & changelog only unreleased
drainpixie Sep 8, 2025
d057f5b
ci: remove changelog commit
drainpixie Sep 8, 2025
1125f26
ci: tagging + version + bump
drainpixie Sep 8, 2025
4bbcd6b
ci: actually install nix in version job
drainpixie Sep 8, 2025
c9fcd03
ci: provenance
drainpixie Sep 8, 2025
5429399
ci: add conditionals for testing
drainpixie Sep 8, 2025
9bd6f8d
ci: publish to pypi
drainpixie Sep 8, 2025
a5b7e84
ci: provenance should be generated on dispatch
drainpixie Sep 8, 2025
0c4582b
ci: cleanup & remove conditionals
drainpixie Sep 8, 2025
bd20928
fix: implement suggestions
drainpixie Sep 9, 2025
5d816e1
ci: also remove token from lint
drainpixie Sep 9, 2025
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
69 changes: 51 additions & 18 deletions .github/workflows/ci-lint-test.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,83 @@
name: "CI: Lint & Test"
on: [push, pull_request]

on: [push, pull]

jobs:
lint:
name: Lint
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v4
- name: "[INIT] Install uv"
uses: astral-sh/setup-uv@v5

- name: "[INIT] Install Nix"
uses: cachix/install-nix-action@v31
with:
python-version: "3.10"
enable-cache: true
- name: "[INIT] Install dependencies"
run: uv sync --locked --all-extras --dev
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix"
uses: cachix/cachix-action@v15
with:
name: proselint
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: "[EXEC] Lint"
run: uv run poe lint
run: nix develop --command ruff check proselint tests

test-cover:
name: Test & Cover
if: "!(contains(github.event.head_commit.message, '[skip_ci]'))"
runs-on: ${{ matrix.os }}
permissions:
id-token: write
defaults:
run:
shell: bash
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- name: "[INIT] Checkout repository"
uses: actions/checkout@v4
- name: "[INIT] Install uv"
uses: astral-sh/setup-uv@v5

- name: "[INIT] Install Nix (Unix)"
if: runner.os != 'Windows'
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: "[INIT] Setup Cachix (Unix)"
if: runner.os != 'Windows'
uses: cachix/cachix-action@v15
with:
name: proselint
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: "[INIT] Install uv (Windows)"
if: runner.os == 'Windows'
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
enable-cache: true
- name: "[INIT] Install dependencies"

- name: "[INIT] Install dependencies (Windows)"
if: runner.os == 'Windows'
run: uv sync --locked --all-extras --dev --group test
- name: "[EXEC] Test"

- name: "[EXEC] Test & Coverage (Windows)"
if: runner.os == 'Windows'
run: uv run poe test-cover
env:
PYTHON_VERSION: ${{ matrix.python }}

- name: "[EXEC] Test & Coverage (Unix)"
if: runner.os != 'Windows'
run: nix develop --command uv run poe test-cover
env:
PYTHON_VERSION: ${{ matrix.python }}

- name: "[EXEC] Upload coverage to Codecov"
uses: codecov/codecov-action@v5
with:
Expand Down
29 changes: 23 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,27 @@
"x86_64-darwin"
"aarch64-darwin"
] (system: function system nixpkgs.legacyPackages.${system});

getPythonVersion = let
val = builtins.getEnv "PYTHON_VERSION";
result =
if val == ""
then "3.12"
else val;
in
builtins.replaceStrings ["."] [""] result;

project = pyproject.lib.project.loadPyproject {projectRoot = ./.;};
in {
devShells =
forAllSystems (system: pkgs: let
python = pkgs.python312;
arg = project.renderers.withPackages {inherit python;};
python = pkgs."python${getPythonVersion}";
arg =
project.renderers.withPackages {
inherit python;
groups = ["test"];
};

pyenv = python.withPackages arg;
check = self.checks.${system}.pre-commit-check;
in {
Expand All @@ -50,7 +65,7 @@

packages =
forAllSystems (system: pkgs: let
python = pkgs.python312;
python = pkgs."python${getPythonVersion}";
attrs = project.renderers.buildPythonPackage {inherit python;};
in {
default = python.pkgs.buildPythonPackage attrs;
Expand All @@ -75,10 +90,12 @@
mixed-line-endings.enable = true;
markdownlint.enable = true;
ruff.enable = true;
pyright = {
pyright = let
pyright = pkgs.basedpyright;
in {
enable = true;
package = pkgs.basedpyright;
entry = "${pkgs.basedpyright}/bin/basedpyright";
package = pyright;
entry = "${pyright}/bin/basedpyright";
};
convco.enable = true;
alejandra.enable = true;
Expand Down