diff --git a/.github/workflows/actions-check.yaml b/.github/workflows/actions-check.yaml new file mode 100644 index 0000000..6778768 --- /dev/null +++ b/.github/workflows/actions-check.yaml @@ -0,0 +1,33 @@ +name: Check actions +on: + push: + paths: + - .github/workflows/*.yaml + - .github/workflows/*.yml + pull_request: + paths: + - .github/workflows/*.yaml + - .github/workflows/*.yml + +jobs: + check-actions-actionlint: + runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:runner-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v5 + with: + go-version: '1.23' + - run: | + go install github.com/rhysd/actionlint/cmd/actionlint@latest + actionlint .github/workflows/*.yaml + check-actions-yamllint: + runs-on: ubuntu-latest + container: + image: ghcr.io/catthehacker/ubuntu:runner-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + - run: | + pipx run yamllint .github/workflows/*.yaml diff --git a/.github/workflows/flake-check.yaml b/.github/workflows/flake-check.yaml index b74f82d..93c4acb 100644 --- a/.github/workflows/flake-check.yaml +++ b/.github/workflows/flake-check.yaml @@ -1,10 +1,10 @@ -name: flake-check +name: Run nix flake check on: push: pull_request: jobs: - build: + flake-check: runs-on: ubuntu-latest container: image: ghcr.io/catthehacker/ubuntu:runner-latest diff --git a/.github/workflows/flake-update.yaml b/.github/workflows/flake-update.yaml index 4102340..b971cd0 100644 --- a/.github/workflows/flake-update.yaml +++ b/.github/workflows/flake-update.yaml @@ -1,11 +1,11 @@ +--- name: Periodic flake update -on: +on: # yamllint disable-line rule:truthy schedule: - - cron: '0 */2 * * *' - workflow_dispatch: + - cron: "0 */2 * * *" - permissions: - contents: write +permissions: + contents: write jobs: flake-update: @@ -23,4 +23,3 @@ jobs: run: nix flake update --commit-lock-file - name: push run: git push - diff --git a/flake.nix b/flake.nix index 648b0a7..59c20c9 100644 --- a/flake.nix +++ b/flake.nix @@ -132,7 +132,13 @@ devShells = forAllSystems ( { pkgs }: { - default = pkgs.mkShell { packages = with pkgs; [ pre-commit ]; }; + default = pkgs.mkShell { + packages = with pkgs; [ + act + actionlint + yamllint + ]; + }; } ); };