Skip to content

Commit 2b2b1e6

Browse files
committed
ci: rename update-scriptsci
This changes how we think about this directory; it does not need to be exclusively for scripts related to updates, but should be a place for any scripts intended to be run by CI workflows. This mindset should make it easier to develop and test the business logic of workflows, without always needing to test "in production" on the nixvim repo or a fork.
1 parent 7388c85 commit 2b2b1e6

18 files changed

+13
-12
lines changed

.github/workflows/update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ jobs:
132132
id: update_flake_lock
133133
if: inputs.update_lock || github.event_name == 'schedule'
134134
run: |
135-
nix-build ./update-scripts -A update
135+
nix-build ./ci -A update
136136
./result/bin/update --commit --github-output
137137
138138
- name: Update generated files
139139
id: generate
140140
if: inputs.generate || github.event_name == 'schedule'
141141
run: |
142142
old=$(git show --no-patch --format=%h)
143-
nix-build ./update-scripts -A generate
143+
nix-build ./ci -A generate
144144
./result/bin/generate --commit
145145
new=$(git show --no-patch --format=%h)
146146
if [ "$old" != "$new" ]; then
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Update scripts
1+
# CI scripts
22

3-
This directory contains update scripts that are not part of the actual flake.
4-
5-
These scripts are used by the `update` CI workflow, so you shouldn't need to run them manually.
6-
This workflow is found at `.github/workflows/update.yml`.
3+
This directory contains CI-related scripts that are not part of the actual flake.
4+
Unless developing or testing changes, you shouldn't need to run them manually.
75

86
## Developing
97

@@ -14,17 +12,20 @@ For example, `nix-build -A generate` will build `./generate.nix` into `./result/
1412
A `shell.nix` is available that will place `generate` on your PATH.
1513

1614
You could use this directory's shell/packages from another working directory by supplying `nix-build` or `nix-shell` with a path.
17-
E.g. `nix-shell ./update-scripts`.
15+
E.g. `nix-shell ./ci`.
1816

1917
## Explanation
2018

21-
These packages are not in the flake outputs for two main reasons:
19+
These packages are not in the flake outputs for three main reasons:
2220
- Packages built using the flake must follow the flake's `nixConfig`
2321
- Packages included in the flake's output are checked by `nix flake check`
22+
- Some of the packages should have no dependency on the flake at all,
23+
allowing this directory to be [sparse checked out][sparse-checkout] by a workflow
2424

25-
Being unable to bypass `nixConfig` is an issue because we want to disable [IFD] for the flake, but not for these generate scripts.
25+
Being unable to bypass `nixConfig` is an issue because we want to disable [IFD] for the flake, but not for these scripts.
2626

2727
If something changes upstream that causes the builds to fail, we don't want this to block us updating `flake.lock`.
2828
We'd still be made aware of any issues by the `update` CI workflow failing.
2929

30+
[sparse-checkout]: https://github.com/actions/checkout#scenarios
3031
[IFD]: https://nixos.org/manual/nix/stable/language/import-from-derivation
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)