mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-26 21:50:44 -06:00
Compare commits
1 commit
00e3781049
...
d23eac866f
Author | SHA1 | Date | |
---|---|---|---|
d23eac866f |
5 changed files with 33 additions and 24 deletions
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
|
@ -3,7 +3,7 @@ name: Build NixOS (on demand)
|
|||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
hosts:
|
||||
host:
|
||||
description: 'list of hosts to build'
|
||||
required: true
|
||||
default: 'othalan algiz'
|
||||
|
@ -14,14 +14,15 @@ on:
|
|||
|
||||
workflow_call:
|
||||
inputs:
|
||||
hosts:
|
||||
host:
|
||||
description: 'list of hosts to build'
|
||||
default: 'othalan algiz'
|
||||
required: true
|
||||
default: 'othalan aligz'
|
||||
type: string
|
||||
|
||||
# concurrency:
|
||||
# group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
|
||||
# cancel-in-progress: true
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.host }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -51,7 +52,6 @@ jobs:
|
|||
|
||||
- name: Build
|
||||
run: |
|
||||
for host in ${{ inputs.hosts }}; do
|
||||
nix run . \
|
||||
-- \
|
||||
build --system-path \
|
||||
|
@ -59,4 +59,3 @@ jobs:
|
|||
--flake . \
|
||||
-- \
|
||||
--print-build-logs
|
||||
done
|
||||
|
|
14
.github/workflows/push.yml
vendored
14
.github/workflows/push.yml
vendored
|
@ -13,6 +13,20 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
# checks:
|
||||
# uses: ./.github/workflows/checks.yml
|
||||
# secrets: inherit
|
||||
|
||||
build:
|
||||
# needs: checks
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
host:
|
||||
- othalan
|
||||
# - mannaz
|
||||
# - algiz
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
host: "${{ matrix.host }}"
|
||||
secrets: inherit
|
||||
|
|
|
@ -55,7 +55,7 @@ func setupLogger() {
|
|||
log.SetReportTimestamp(false)
|
||||
styles := log.DefaultStyles()
|
||||
for k, v := range styles.Levels {
|
||||
styles.Levels[k] = v.Width(5).MaxWidth(5)
|
||||
styles.Levels[k] = v.MaxWidth(10)
|
||||
}
|
||||
log.SetStyles(styles)
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
self,
|
||||
lib,
|
||||
installShellFiles,
|
||||
buildGoModule,
|
||||
|
@ -8,11 +9,11 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) cleanSource makeBinPath;
|
||||
inherit (lib) mkDate cleanSource makeBinPath;
|
||||
in
|
||||
buildGoModule {
|
||||
pname = "oizys";
|
||||
version = "unstable";
|
||||
version = "${self.shortRev or "dirty"}";
|
||||
|
||||
src = cleanSource ./.;
|
||||
vendorHash = "sha256-/JVXhXrU2np/ty7AGFy+LPZCo1NaLYl9NAyD9+FJYBI=";
|
||||
|
|
|
@ -190,7 +190,6 @@ func (p *packages) summary() {
|
|||
Render(fmt.Sprint(len(p.names))),
|
||||
)
|
||||
}
|
||||
|
||||
func logCmd(cmd *exec.Cmd) {
|
||||
log.Debugf("CMD: %s", strings.Join(cmd.Args, " "))
|
||||
}
|
||||
|
@ -238,13 +237,9 @@ func parseDryRun(buf string) (*packages, *packages) {
|
|||
var parts [2][]string
|
||||
i := 0
|
||||
for _, line := range lines {
|
||||
if strings.Contains(line, "fetch") && strings.HasSuffix(line, ":") {
|
||||
if strings.Contains(line, "fetch") {
|
||||
i++
|
||||
}
|
||||
if i == 2 {
|
||||
log.Fatal("failed to parse output", "output", buf)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(line, " ") {
|
||||
parts[i] = append(parts[i], line)
|
||||
}
|
||||
|
@ -252,7 +247,7 @@ func parseDryRun(buf string) (*packages, *packages) {
|
|||
|
||||
if len(parts[0])+len(parts[1]) == 0 {
|
||||
log.Info("no changes...")
|
||||
os.Exit(0)
|
||||
log.Fatal("or failed to parse nix build --dry-run output")
|
||||
}
|
||||
|
||||
return parsePackages(parts[0], "packages to build"),
|
||||
|
|
Loading…
Reference in a new issue