Commit graph

26 commits

Author SHA1 Message Date
Marien Zwart
0c55f6064f
CI: try to make push of flake-update to main work
It currently fails with

```
 ! [rejected]        HEAD -> main (fetch first)
error: failed to push some refs to 'https://github.com/marienz/nix-doom-emacs-unstraightened'
hint: Updates were rejected because the remote contains work that you do not
hint: have locally. This is usually caused by another repository pushing to
hint: the same ref. If you want to integrate the remote changes, use
hint: 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for
details.
```

Our local checkout is shallow. Assume we can fix this by fetching just
the parent of the commit we want to push, which should be the commit
origin/main points at.
2024-06-22 22:29:35 +10:00
Marien Zwart
13e64824f4
CI: fix permissions 2024-06-22 21:09:32 +10:00
Marien Zwart
8c7b188ae5
CI: break up "CI" workflow
Break the single job into four stages: `nix flake update`, checks,
cachix, push to main.

The benefit is that checks and cachix can use a matrix strategy in the
future (to test / build for different OSes and nixpkgs releases). Also,
the cachix build can run in parallel with checks.

The downside is that we need to push to a temporary branch before we can
run checks. Do that the simplest possible way (just hardcode the branch
name).
2024-06-22 20:48:03 +10:00
Marien Zwart
40a3228e64
CI: make check/cachix callable with ref input
...so that a reworked "ci" workflow run from a schedule can use them to
check a staging branch rather than "main".
2024-06-22 20:30:47 +10:00
Marien Zwart
816827ffed
CI: fix config error 2024-06-22 20:13:07 +10:00
Marien Zwart
8f0941c8d7
CI: experimental flake-update workflow
I want to use a matrix strategy for the check and cachix workflows, so I
need to not just commit but also push the updated flake.lock somewhere
other than `main`, so multiple workers can check out the pending change.

Try the simplest possible thing first, expecting it to fail with
permission issues.
2024-06-22 20:04:51 +10:00
Marien Zwart
5bdfc4e1a5
CI: run just the new "check" workflow on push 2024-06-22 16:43:10 +10:00
Marien Zwart
7e62ee35b0
CI: Add dedicated check and cachix workflows 2024-06-22 16:20:36 +10:00
Marien Zwart
8ceb9a7431
CI: move download caching to a composite action
I intend to split the "CI" workflow into a "check" and "build for
cachix" workflow, and both will use this action.
2024-06-22 15:47:07 +10:00
marienz
73cd965483
Merge pull request #10 from marienz/fetchtree
Improve fetching performance (mainly for CI)
2024-05-27 19:59:14 +10:00
dependabot[bot]
31eaef41a1 Bump cachix/cachix-action from 14 to 15
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 14 to 15.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v14...v15)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-27 19:50:04 +10:00
Marien Zwart
c042f8d6f0
Disable magic nix cache's flakehub integration
This should not be doing anything, and I saw it stall (to retry
requests) once or twice.
2024-05-26 23:29:18 +10:00
Marien Zwart
0e996d2ccb
Rework CI caching, adding tarball cache
Using the lockfile hash as cache key did not make much sense, since
changes to Unstraightened itself change what we fetch.

And a static restore key means we never flush our cache: that might be
ok if cache size was reasonable, but it is not (over 3 GiB).

Switch to using the date as cache key, and only restore caches from the
current month.

Add tarballs as a second cache.

I considered caching all of ~/.cache/nix, but do not want to find out
the hard way any (new) caches are not portable if I add CI for other
platforms. The tarball-cache seems to be another git tree, so it should
be ok.
2024-05-26 23:01:30 +10:00
Marien Zwart
a55e257b13 CI: try to fix flake-checker
CI is failing with 'Error: Invalid("no nixpkgs dependency found for
specified key: ")`, probably because of this leftover start at multiple
nixpkgs inputs.

Remove it.
2024-05-23 20:16:15 +10:00
Marien Zwart
a40637115a
CI: write to Cachix
This is only a starting point. For this to be more useful, we need to
build for multiple Emacsen. But I want to get a baseline for the size of
the closure first (as well as confirming it works in the first place).
2024-05-19 17:51:43 +10:00
marienz
b7b1a944d9
Create dependabot.yml 2024-05-19 16:45:45 +10:00
Marien Zwart
26ca403bec Comment on rough edges of CI workflow 2024-05-19 13:40:32 +10:00
Marien Zwart
cd7a5a3954
CI: daily automated flake.lock update
Manual test run succeeded.
2024-05-19 12:58:50 +10:00
Marien Zwart
157b05763e
CI: request contents write access
commit failed with a 403, and this permission bit is probably why.
2024-05-19 00:05:03 +10:00
Marien Zwart
cc8d2ea320
CI: Specify identity when committing
Git refuses to commit otherwise.

Identity cargo-culted from other projects / answers.
2024-05-18 23:07:53 +10:00
Marien Zwart
6aad68a612 CI: add nix flake update and commit steps
And rename the workflow as it no longer runs just checks.
2024-05-18 22:20:56 +10:00
Marien Zwart
db62bca56c CI: save gitv3 cache
A cache hit on restore means the cache is not saved afterwards.
2024-05-18 22:20:56 +10:00
Marien Zwart
b085d95461 CI: nicer names
(...triggering another CI run to test the git checkout cache)
2024-05-18 22:20:56 +10:00
Marien Zwart
8a2d602ae2 CI: try to cache Nix's git checkouts 2024-05-18 22:20:56 +10:00
Marien Zwart
4cd93c5552 More verbose errors in CI
(Also, trigger CI again so I can see if the cache works...)
2024-05-18 22:20:56 +10:00
Marien Zwart
2e2548e80f Add nix flake check github workflow 2024-05-18 22:20:56 +10:00