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

Add action to update flake.lock and related CI/.ruby-version dependencies #121

Merged
merged 3 commits into from
Sep 29, 2023
Merged
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
1 change: 0 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash

nix_direnv_watch_file .ruby-version
use flake
9 changes: 0 additions & 9 deletions .github/renovate.json

This file was deleted.

6 changes: 2 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -14,16 +14,14 @@ jobs:
- uses: actions/checkout@v4
- uses: dprint/check@v2.2
with:
# Keep same version as used in *.nix
dprint-version: '0.40.0'
dprint-version: '0.40.0' # selfup { "regex": "\\d[^']+", "script": "dprint --version | cut -d ' ' -f 2" }

typos:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Keep same version as used in *.nix
- uses: crate-ci/typos@v1.16.4
- uses: crate-ci/typos@v1.16.4 # selfup { "regex": "\\d\\.\\d+\\.\\d+", "script": "typos --version | cut -d ' ' -f 2" }
with:
files: |
.
23 changes: 23 additions & 0 deletions .github/workflows/update-nixpkgs-and-versions-in-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Update nixpkgs and CI dependencies
on:
pull_request:
paths:
- '.github/workflows/update-nixpkgs-and-versions-in-ci.yml'
schedule:
# Every Monday 10:17 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '17 1 * * 1'
workflow_dispatch:

jobs:
update-nixpkgs:
uses: kachick/anylang-template/.github/workflows/reusable-update-nixpkgs-and-versions-in-ci.yml@2413fce002263e6675ce084da251be0dbbe2a8fc
if: (github.event.sender.login == 'kachick') || (github.event_name != 'pull_request')
with:
dry-run: ${{ github.event_name == 'pull_request' }}
optional-run: |
ruby -e 'puts RUBY_VERSION' > .ruby-version
git diff-index --quiet HEAD || git commit -m 'Update .ruby-version' .ruby-version
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
56 changes: 1 addition & 55 deletions flake.lock

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

10 changes: 2 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -6,19 +6,13 @@
# How to update the revision
# - `nix flake update --commit-lock-file` # https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-update.html
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-ruby.url = "github:bobvanderlinden/nixpkgs-ruby";
nixpkgs-ruby.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, nixpkgs-ruby, flake-utils }:
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ruby = nixpkgs-ruby.lib.packageFromRubyVersionFile {
file = ./.ruby-version;
inherit system;
};
in
{
devShells.default = with pkgs;
@@ -28,7 +22,7 @@
# https://github.com/kachick/dotfiles/pull/228
bashInteractive

ruby
ruby_3_2
# Required to build psych via irb dependency
# https://github.com/kachick/irb-power_assert/issues/116
# https://github.com/ruby/irb/pull/648