Skip to content
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

ci(dependabot): init #50

Merged
merged 4 commits into from
Aug 7, 2024
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
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi
Expand All @@ -12,7 +14,6 @@ watch_file flake.lock
[ -f flake-parts/treefmt.nix ] && watch_file flake-parts/treefmt.nix
[ -f flake-parts/pre-commit-hooks.nix ] && watch_file flake-parts/pre-commit-hooks.nix


# Check which devshell implementation we are using and load that one
if [ -f flake-parts/devenv/dev.nix ]; then
if ! use flake .#dev --accept-flake-config --override-input devenv-root "file+file://"<(printf %s "$PWD"); then
Expand Down
12 changes: 8 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---

## name: Bug report about: Create a report to help us improve title: "" labels: bug assignees: ""
name: 🪲 Bug Report
about: Create a bug report to help us resolve the bug
title: "🪲[BUG]: "
labels: "bug"
assignees: ""
---

## Describe the bug

Expand Down Expand Up @@ -29,8 +33,8 @@ Add any other context about the problem here.
## Notify maintainers

<!--
Please @ people who are in the `meta.maintainers` list of the offending package or module.
If in doubt, check `git blame` for whoever last touched something.
Please @ people who are in the `meta.maintainers` list of the offending package
or module. If in doubt, check `git blame` for whoever last touched something.
-->

## Metadata
Expand Down
21 changes: 15 additions & 6 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
---
name: 💡 Feature Request
about: Suggest an interesting feature idea for this project
title: "💡[FEATURE]: "
labels: "enhancement"
assignees: ""
---

## Is your feature request related to a problem? Please describe

## name: Feature request about: Suggest an idea for this project title: "" labels: feature-request assignees: ""
A clear and concise description of what the problem is. Ex. I'm always frustrated
when \[...\]

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when \[...\]
## Describe the solution you'd like

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
## Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
## Additional context

Add any other context or screenshots about the feature request here.

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD041 -->

## Overview

<!-- Provide a brief overview of what this PR aims to accomplish. For instance,
Expand Down Expand Up @@ -26,13 +28,13 @@ updates (if applicable). -->

<!-- Ensure you've gone through this checklist before submitting your PR. -->

- \[ \] I have tested the relevant changes locally.
- \[ \] I have checked that `nix flake check` passes.
- \[ \] I have ensured my commits follow the project's commits guidelines.
- \[ \] I have checked that the changes follow a linear history.
- \[ \] (If applicable) I have commented any relevant parts of my code.
- \[ \] (If applicable) I have added appropriate unit/feature tests.
- \[ \] (If applicable) I have updated the documentation accordingly (in English).
- [ ] I have tested the relevant changes locally.
- [ ] I have checked that `nix flake check` passes.
- [ ] I have ensured my commits follow the project's commits guidelines.
- [ ] I have checked that the changes follow a linear history.
- [ ] (If applicable) I have commented any relevant parts of my code.
- [ ] (If applicable) I have added appropriate unit/feature tests.
- [ ] (If applicable) I have updated the documentation accordingly (in English).

## Additional Notes

Expand Down
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- dependencies
# NOTE: For additional ecosystems refer to the documentation
# package-ecosystem: "gitsubmodule"
# directory: "/"
# schedule:
# interval: "weekly"
# labels:
# - dependencies

# - package-ecosystem: "docker"
# directory: "/"
# schedule:
# interval: "weekly"
# labels:
# - dependencies
8 changes: 0 additions & 8 deletions .github/workflows/cachix-push.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,35 @@
# --- Push packages & devshells to the cachix binary cache service
name: cachix push

on:
workflow_dispatch: # allows manual triggering from the Actions UI
push:
branches:
- main

jobs:
cachix-push:
runs-on: "ubuntu-latest"
steps:
- name: "Checking out repository..."
uses: actions/checkout@v4

- name: "Installing and configuring the nix package manager..."
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
allow-import-from-derivation = true

- name: "Setting up magic-nix-cache..."
uses: DeterminateSystems/magic-nix-cache-action@main

- name: "Settings up cachix binary cache..."
uses: cachix/cachix-action@v15
with:
name: tsandrini
# If you chose API tokens for write access OR if you have a private cache
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

# NOTE Install any necessary packages here
- name: "Setting up packages..."
run: |
nix profile install nixpkgs#nix-fast-build # parallel nix builder

- name: "Running `nix build ...`..."
run: nix-fast-build --skip-cached --no-nom --flake ".#packages.$(nix eval --raw --impure --expr builtins.currentSystem)"

- name: "Running `nix develop...`..."
run: nix-fast-build --skip-cached --no-nom --flake ".#devShells.$(nix eval --raw --impure --expr builtins.currentSystem)"
9 changes: 0 additions & 9 deletions .github/workflows/flake-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# --- Run `nix flake check`
name: nix flake check

on:
workflow_dispatch: # allows manual triggering from the Actions UI
push:
Expand All @@ -10,37 +9,29 @@ on:
types: [opened, reopened, synchronize]
repository_dispatch:
types: [create-pull-request]

jobs:
flake-check:
runs-on: "ubuntu-latest"
steps:
- name: "Checking out repository..."
uses: actions/checkout@v4

- name: "Installing and configuring the nix package manager..."
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
allow-import-from-derivation = true

- name: "Setting up magic-nix-cache..."
uses: DeterminateSystems/magic-nix-cache-action@main

# NOTE Install any necessary packages here
- name: "Setting up packages..."
run: |
nix profile install nixpkgs#nix-fast-build # parallel nix builder

- name: "Running `nix flake check`..."
run: nix-fast-build --skip-cached --no-nom --flake ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)"

- name: "Running `nix build ...`..."
run: nix-fast-build --skip-cached --no-nom --flake ".#packages.$(nix eval --raw --impure --expr builtins.currentSystem)"

- name: "Running `nix develop...`..."
run: nix-fast-build --skip-cached --no-nom --flake ".#devShells.$(nix eval --raw --impure --expr builtins.currentSystem)"

- name: "Checking flake inputs for stale & insecure nixpkgs versions..."
uses: DeterminateSystems/flake-checker-action@main
5 changes: 0 additions & 5 deletions .github/workflows/flakehub-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# --- Publish flake to FlakeHub
name: FlakeHub

on:
workflow_dispatch: # allows manual triggering from the Actions UI
push:
branches:
- main

jobs:
flakehub-publish:
runs-on: "ubuntu-latest"
Expand All @@ -16,17 +14,14 @@ jobs:
steps:
- name: "Checking out repository..."
uses: actions/checkout@v4

- name: "Installing and configuring the nix package manager..."
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
allow-import-from-derivation = true

- name: "Setting up magic-nix-cache..."
uses: DeterminateSystems/magic-nix-cache-action@main

- name: "Publishing flake to FlakeHub..."
uses: DeterminateSystems/flakehub-push@main
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
# --- Periodically update flake inputs in flake.lock
name: update-flake-lock

on:
workflow_dispatch: # allows manual triggering from the Actions UI
schedule:
- cron: "0 0 * * 0" # runs weekly on Sunday at 00:00

jobs:
update-flake-lock:
runs-on: ubuntu-latest
steps:
- name: "Checking out repository..."
uses: actions/checkout@v4

- name: "Installing and configuring the nix package manager..."
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
allow-import-from-derivation = true

- name: "Setting up magic-nix-cache..."
uses: DeterminateSystems/magic-nix-cache-action@main

- name: "Updating flake.lock..."
uses: DeterminateSystems/update-flake-lock@main
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD024 -->

# Changelog

## v0.4.0 (2024-08-06)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The project is also hosted on [FlakeHub](https://flakehub.com/flake/tsandrini/te
## 2. Design choices ⚙️

- This projects is generated via and uses
https://github.com/tsandrini/flake-parts-builder
[flake-parts-builder](https://github.com/tsandrini/flake-parts-builder)
which makes it super easy to share modularity between different projects.
- Modules are disabled by default. Why you might ask? 🤓 ... Setting
`myModule.enable = true;` can be done from multiple places, moreover we can
Expand Down
6 changes: 3 additions & 3 deletions flake-parts/pre-commit-hooks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
treefmt.package = if (treefmt-wrapper != null) then treefmt-wrapper else pkgs.treefmt;

nil.enable = true; # Nix Language server, an incremental analysis assistant for writing in Nix.
# markdownlint.enable = true; # Markdown lint tool
# typos.enable = true; # Source code spell checker
markdownlint.enable = true; # Markdown lint tool

# actionlint.enable = true; # GitHub workflows linting
commitizen.enable = true; # Commitizen is release management tool designed for teams.
editorconfig-checker.enable = true; # A tool to verify that your files are in harmony with your .editorconfig
# actionlint.enable = true; # GitHub workflows linting
# typos.enable = true; # Source code spell checker

gitleaks = {
enable = true;
Expand Down
21 changes: 14 additions & 7 deletions flake-parts/treefmt.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,28 @@
"*.woff2"
"flake-parts/pkgs/docs/**/*"
];
shellcheck.includes = [
"*.sh"
".envrc"
];
prettier.editorconfig = true;
};

programs = {
deadnix.enable = true; # Find and remove unused code in .nix source files
statix.enable = true; # Lints and suggestions for the nix programming language
nixfmt.enable = true; # An opinionated formatter for Nix
# NOTE Choose a different formatter if you'd like to
# nixfmt.enable = true; # An opinionated formatter for Nix
# alejandra.enable = true; # The Uncompromising Nix Code Formatter

actionlint.enable = true; # Static checker for GitHub Actions workflow files
prettier.enable = true; # Prettier is an opinionated code formatter
mdformat.enable = true; # CommonMark compliant Markdown formatter
# yamlfmt.enable = true; # An extensible command line tool or library to format yaml files.
# jsonfmt.enable = true; # Formatter for JSON files
yamlfmt.enable = true; # An extensible command line tool or library to format yaml files.
jsonfmt.enable = true; # Formatter for JSON files
# mdformat.enable = true; # CommonMark compliant Markdown formatter

shellcheck.enable = true; # Shell script analysis tool
shfmt.enable = true; # Shell parser and formatter

actionlint.enable = true; # Static checker for GitHub Actions workflow files
# mdsh.enable = true; # Markdown shell pre-processor
};
};
};
Expand Down