diff --git a/.gitea/workflows/checks.yaml b/.gitea/workflows/checks.yaml index ca84d435..7f1fda2f 100644 --- a/.gitea/workflows/checks.yaml +++ b/.gitea/workflows/checks.yaml @@ -8,4 +8,4 @@ jobs: runs-on: nix steps: - uses: actions/checkout@v3 - - run: bash ./scripts/ci + - run: nix run --refresh github:Mic92/nix-ci-build diff --git a/scripts/ci b/scripts/ci deleted file mode 100755 index 85e76654..00000000 --- a/scripts/ci +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -args=( - "$@" - --accept-flake-config - --gc-roots-dir gc-root - --option allow-import-from-derivation false - --show-trace - --force-recurse - --workers "$(nproc)" - --flake ".#checks.x86_64-linux" -) - -summary=summary.log - -if [[ -n "${GITHUB_STEP_SUMMARY-}" ]]; then - log() { - echo "$*" >> "$GITHUB_STEP_SUMMARY" - } -else - log() { - echo "$*" > "$summary" - } -fi - -rc=0 - -nix shell --inputs-from '.#' "nixpkgs#nix-eval-jobs" -c nix-eval-jobs "${args[@]}" > "jobs.json" - -for job in $(jq -r '. | @base64' < "jobs.json"); do - job=$(echo "$job" | base64 -d) - attr=$(echo "$job" | jq -r .attr) - echo "### $attr" - error=$(echo "$job" | jq -r .error) - if [[ $error != null ]]; then - log "### ❌ $attr" - log - log "Eval error:" - log "$error" - log "" - rc=1 - else - drvPath=$(echo "$job" | jq -r .drvPath) - if ! nix-store --option keep-going true --realize "$drvPath" 2>&1 | tee build-log.txt; then - log "### ❌ $attr" - log - log "Build error:last 50 lines:" - log "$(tail -n 50 build-log.txt)" - log "" - rc=1 - else - log "### ✅ $attr" - fi - log - rm build-log.txt - fi -done - -if [[ -f "$summary" ]]; then cat "$summary"; fi -exit "$rc"
" - log "$error" - log "
" - log "$(tail -n 50 build-log.txt)" - log "