add github CI (#70)

This commit is contained in:
Michael Schneider 2024-02-23 20:07:24 +07:00 committed by GitHub
parent 72273b9028
commit 02a9761ac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 4 deletions

17
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: "Check"
on:
pull_request:
# cancel previous runs when pushing new changes
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
extra_nix_config: "system-features = kvm nixos-test"
- run: nix flake check -L --keep-going
- run: nix flake check -L --keep-going ./example

4
.gitignore vendored
View File

@ -1 +1,3 @@
/example/result
result-*
result
.direnv

View File

@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
{
programs.plasma = {
enable = true;

View File

@ -3,7 +3,7 @@ import json
import os
import re
import sys
from typing import Dict
from typing import Dict, Optional
class KConfParser:
@ -89,7 +89,7 @@ class KConfParser:
f.write(f"{self.key_value_to_line(key, value)}\n")
@staticmethod
def get_key_value(line: str) -> tuple[str, str | None]:
def get_key_value(line: str) -> tuple[str, Optional[str]]:
line_splitted = line.split("=", 1)
key = line_splitted[0].strip()
value = line_splitted[1].strip() if len(line_splitted) > 1 else None