fix: CI _preflight, swap tea→fgj, add ci-logs helper
- flake.nix: replace tea with fgj (fetchurl of v0.4.0 linux_amd64 binary) - flake.nix shellHook: export IN_NIX_SHELL=1 so that nix develop --command sets the variable that _preflight checks (nix develop does not set it automatically, unlike the old nix-shell) - Taskfile.yml _preflight: use IN_NIX_SHELL check instead of DIRENV_DIR, which never worked in CI - scripts/ci_logs.sh + task ci-logs: fetch raw Codeberg Actions job logs from the web-UI endpoint (API endpoint not available on Codeberg 15.0.0) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
d58ed9ebc4
commit
76278d6f69
+6
-1
@@ -34,7 +34,7 @@ tasks:
|
||||
run: once
|
||||
deps: [_nix-check]
|
||||
preconditions:
|
||||
- sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}"
|
||||
- sh: test -n "${IN_NIX_SHELL}"
|
||||
msg: "Not in nix dev shell. Run: nix develop"
|
||||
cmds:
|
||||
- scripts/silent_on_success.sh pre-commit install
|
||||
@@ -368,6 +368,11 @@ tasks:
|
||||
- task: integration
|
||||
- task: integration-ui
|
||||
|
||||
ci-logs:
|
||||
desc: "Fetch latest CI job logs from Codeberg. Usage: task ci-logs [RUN=8] [JOB=0]"
|
||||
cmds:
|
||||
- scripts/ci_logs.sh "{{.RUN}}" "{{.JOB}}"
|
||||
|
||||
check:
|
||||
desc: Full check suite — unit tests first, then integration (merges coverage), then gate
|
||||
deps: [analyze, build-linux, test]
|
||||
|
||||
@@ -28,6 +28,20 @@
|
||||
gdk-pixbuf
|
||||
harfbuzz
|
||||
];
|
||||
fgj = pkgs.stdenv.mkDerivation {
|
||||
pname = "fgj";
|
||||
version = "0.4.0";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://codeberg.org/romaintb/fgj/releases/download/v0.4.0/fgj_linux_amd64";
|
||||
sha256 = "07pia03facvvxq9i1dgl7p47ccv1iqj4drpkp45gvw26d4afkbj7";
|
||||
};
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $src $out/bin/fgj
|
||||
chmod +x $out/bin/fgj
|
||||
'';
|
||||
};
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
@@ -68,10 +82,13 @@
|
||||
jq
|
||||
sqlite
|
||||
python3 # used by stalwart-dev/start to pick random ports
|
||||
tea # Gitea CLI
|
||||
fgj # Codeberg/Forgejo CLI (like gh for GitHub)
|
||||
]);
|
||||
|
||||
shellHook = ''
|
||||
# nix develop --command does not set IN_NIX_SHELL; set it so _preflight passes in CI
|
||||
export IN_NIX_SHELL=1
|
||||
|
||||
# Disable Flutter telemetry inside dev shell
|
||||
export FLUTTER_SUPPRESS_ANALYTICS=true
|
||||
|
||||
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO="guettli/sharedinbox"
|
||||
RUN="${1:-}"
|
||||
JOB="${2:-0}"
|
||||
|
||||
if [ -z "$RUN" ]; then
|
||||
RUN=$(curl -sf "https://codeberg.org/api/v1/repos/$REPO/actions/tasks?limit=10" \
|
||||
| python3 -c "
|
||||
import json, sys
|
||||
data = json.load(sys.stdin)
|
||||
for r in data.get('workflow_runs', []):
|
||||
if r['status'] != 'skipped':
|
||||
print(r['run_number'])
|
||||
break
|
||||
")
|
||||
echo "Latest non-skipped run: #$RUN" >&2
|
||||
fi
|
||||
|
||||
URL="https://codeberg.org/$REPO/actions/runs/$RUN/jobs/$JOB/attempt/1/logs"
|
||||
echo "Fetching: $URL" >&2
|
||||
echo "---" >&2
|
||||
curl -sf "$URL"
|
||||
Reference in New Issue
Block a user