Skip to content

Commit

Permalink
chore: Add all missing nix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuelbert committed Nov 9, 2024
1 parent 467d83b commit ee702b1
Show file tree
Hide file tree
Showing 9 changed files with 363 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/external-data-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check for updates
on:
schedule:
- cron: 0 0 13 * * # run on the 13th every month
workflow_dispatch:
jobs:
flatpak-external-data-checker:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [main]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: docker://ghrc.io/flathub/flatpak-exernal-data-checker:latest
env:
GIT_AUTHOR_NAME: Flatpak External Data Checker
GIT_COMMITTER_NAME: Flatpak External Data Checker
# email sets "github-actions[bot]" as commit author. see https://github.community/t/github-actions-bot-email-address/17204/6
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
with:
args: --update --never-fork packaging/linux/com.jmuelbert.jmbde.yaml
21 changes: 21 additions & 0 deletions .github/workflows/flake-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Nix Flake
on:
pull_request:
branches: [main]
paths:
- '**.nix'
- .github/workflows/flake-checker.yml
- flake.lock
push:
branches:
- main
paths:
- '**.nix'
- .github/workflows/flakechecker.yml
- flake.lock
jobs:
flake-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/flake-checker-action@v9
Empty file.
24 changes: 24 additions & 0 deletions .github/workflows/lock-updater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Flake ❄️ Lock 🔒️ Updater ✨
on:
schedule:
# Run on the third of the month
- cron: 0 0 3 * *
workflow_dispatch:
jobs:
lock-updater:
name: Flake Lock Updater
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: DeterminateSystems/update-flake-lock@v24
with:
pr_assignees: ${{ github.repository_owner }}
pr_labels: |
automated
dependencies
pr_title: "chore: update flake.lock"
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
40 changes: 40 additions & 0 deletions .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: schedule
on:
workflow_dispatch:
schedule:
# Run on the third of every month
- cron: 0 0 3 * *
jobs:
coverage-main-branch:
strategy:
fail-fast: true
matrix:
compiler: [clang]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Restore ccache cache
id: cache-ccache-restore
uses: action/cache/restore@v4
with:
key: coverage-${{ matrix.compiler }}-cache-
path: .ccache
- name: Generate Coverage
run: nix develop --command just workflow coverage-${{ matrix.compiler }}
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::echo timestamp=${current_date}")
- name: Save ccache cache
uses: actions/cache/save@v4
if: always() && steps.cache-ccache-restore.outputs.cache-hit != 'true'
with:
key: coverage-${{ matrix.compiler }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
path: .ccache
- uses: clearlyip/code-coverage-report-action@v5
with:
filename: build-coverage-${{ matrix.compiler }}/cobertura.xml
54 changes: 54 additions & 0 deletions .github/workflows/treefamt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Check files with treefmt
"on":
pull_request:
branches: [main]
paths:
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.json'
- '**.just'
- '**.nix'
- '**.toml'
- '**.yaml'
- '**.yml'
- '**/.justfile'
- '**/CMakeLists.txt'
- '**/justfile'
- .clang-format
- .github/workflows/treefmt.yaml
- flake.lock
push:
branches: [main]
paths:
- '**.cmake'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.json'
- '**.just'
- '**.nix'
- '**.toml'
- '**.yaml'
- '**.yml'
- '**/.justfile'
- '**/CMakeLists.txt'
- '**/justfile'
- .clang-format
- .github/workflows/treefmt.yaml
- flake.lock
jobs:
treefmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v14
- uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Run treefmt
run: nix develop --command treefmt --ci
- uses: reviewdog/action-suggester@v1
with:
fail_on_error: true
github_token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
tool_name: treefmt
178 changes: 178 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@
pre-commit = pre-commit-hooks.lib.${system}.run (
import ./pre-commit-hooks.nix { inherit pkgs treefmtEval; }
);
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt-nix;
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
with pkgs;
{
apps = {
inherit (nix-update-scripts.apps.${system}) update-nix-direnv;
};
devShells.default = mkShell {
inherit (pre-commit) shellHook;
buildInputs = with pkgs; [
microsoft-gsl
qt6.qtbase
qt6.wayland
qt6.qtwayland
ut
];
nativeBuildInputs =
Expand All @@ -72,7 +75,7 @@
gdb
include-what-you-use
just
lonv
lcov
librsvg
lldb
llvm
Expand All @@ -83,7 +86,7 @@
nushell
python311Packages.lcov-cobertura
qt6.wrapQtAppsHook
treefmtEcal.config.build.wrapper
treefmtEval.config.build.wrapper
(builtins.attrValues treefmtEval.config.build.programs)
]
++ pre-commit.enabledPackages;
Expand Down
Loading

0 comments on commit ee702b1

Please sign in to comment.