actions: update workflows, use script
This commit is contained in:
parent
f2300f0689
commit
c8ad36040f
20
.github/workflows/build-then-cache.yaml
vendored
20
.github/workflows/build-then-cache.yaml
vendored
@ -10,6 +10,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
- uses: DeterminateSystems/nix-installer-action@v16
|
||||||
|
with:
|
||||||
|
extra-conf: |
|
||||||
|
keep-going = true
|
||||||
|
fallback = true
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
- uses: DeterminateSystems/flake-checker-action@v9
|
||||||
- uses: ryanccn/attic-action@v0
|
- uses: ryanccn/attic-action@v0
|
||||||
with:
|
with:
|
||||||
@ -19,26 +23,34 @@ jobs:
|
|||||||
# free useless disk space
|
# free useless disk space
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
- run: 'bash ci/util_free_space_extreme.sh'
|
||||||
# TODO: figure out how to use flake checks and use those to build it
|
# TODO: figure out how to use flake checks and use those to build it
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.rpi4.config.system.build.toplevel'
|
- run: 'nix develop .#ci --command bash ci/run_builds.sh'
|
||||||
|
|
||||||
build_x86-64_packages:
|
build_x86-64_packages:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
- uses: DeterminateSystems/nix-installer-action@v16
|
||||||
|
with:
|
||||||
|
extra-conf: |
|
||||||
|
keep-going = true
|
||||||
|
fallback = true
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
- uses: DeterminateSystems/flake-checker-action@v9
|
||||||
- uses: ryanccn/attic-action@v0
|
- uses: ryanccn/attic-action@v0
|
||||||
with:
|
with:
|
||||||
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
|
||||||
cache: ${{ secrets.ATTIC_CACHE }}
|
cache: ${{ secrets.ATTIC_CACHE }}
|
||||||
token: ${{ secrets.ATTIC_TOKEN }}
|
token: ${{ secrets.ATTIC_TOKEN }}
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#packages.x86_64-linux.redlib'
|
- run: 'nix develop .#ci --command bash ci/run_builds.sh packages'
|
||||||
|
|
||||||
build_x86-64:
|
build_x86-64:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
- uses: DeterminateSystems/nix-installer-action@v16
|
||||||
|
with:
|
||||||
|
extra-conf: |
|
||||||
|
keep-going = true
|
||||||
|
fallback = true
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
- uses: DeterminateSystems/flake-checker-action@v9
|
||||||
- uses: ryanccn/attic-action@v0
|
- uses: ryanccn/attic-action@v0
|
||||||
with:
|
with:
|
||||||
@ -48,6 +60,4 @@ jobs:
|
|||||||
# free useless disk space
|
# free useless disk space
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
- run: 'bash ci/util_free_space_extreme.sh'
|
||||||
# TODO: figure out how to use flake checks and use those to build it
|
# TODO: figure out how to use flake checks and use those to build it
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.slab.config.system.build.toplevel'
|
- run: 'nix develop .#ci --command bash ci/run_builds.sh config'
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.nullbox.config.system.build.toplevel'
|
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.nixos-wsl.config.system.build.toplevel'
|
|
||||||
|
14
.github/workflows/proactive-update.yaml
vendored
14
.github/workflows/proactive-update.yaml
vendored
@ -13,6 +13,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
- uses: DeterminateSystems/nix-installer-action@v16
|
||||||
|
with:
|
||||||
|
extra-conf: |
|
||||||
|
keep-going = true
|
||||||
|
fallback = true
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
- uses: DeterminateSystems/flake-checker-action@v9
|
||||||
- uses: ryanccn/attic-action@v0
|
- uses: ryanccn/attic-action@v0
|
||||||
with:
|
with:
|
||||||
@ -22,13 +26,17 @@ jobs:
|
|||||||
# free useless disk space
|
# free useless disk space
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
- run: 'bash ci/util_free_space_extreme.sh'
|
||||||
- run: 'nix flake update'
|
- run: 'nix flake update'
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.rpi4.config.system.build.toplevel'
|
- run: 'nix develop .#ci --command bash ci/run_builds.sh'
|
||||||
|
|
||||||
build_x86:
|
build_x86:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@v16
|
- uses: DeterminateSystems/nix-installer-action@v16
|
||||||
|
with:
|
||||||
|
extra-conf: |
|
||||||
|
keep-going = true
|
||||||
|
fallback = true
|
||||||
- uses: DeterminateSystems/flake-checker-action@v9
|
- uses: DeterminateSystems/flake-checker-action@v9
|
||||||
- uses: ryanccn/attic-action@v0
|
- uses: ryanccn/attic-action@v0
|
||||||
with:
|
with:
|
||||||
@ -38,6 +46,4 @@ jobs:
|
|||||||
# free useless disk space
|
# free useless disk space
|
||||||
- run: 'bash ci/util_free_space_extreme.sh'
|
- run: 'bash ci/util_free_space_extreme.sh'
|
||||||
- run: 'nix flake update'
|
- run: 'nix flake update'
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.nullbox.config.system.build.toplevel'
|
- run: 'nix develop .#ci --command bash ci/run_builds.sh'
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.slab.config.system.build.toplevel'
|
|
||||||
- run: 'nix develop .#ci --command nix-fast-build --eval-workers 1 --no-nom --skip-cache -f .#nixosConfigurations.nixos-wsl.config.system.build.toplevel'
|
|
||||||
|
57
ci/run_builds.sh
Executable file
57
ci/run_builds.sh
Executable file
@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -Exo pipefail
|
||||||
|
|
||||||
|
err=0
|
||||||
|
|
||||||
|
set_error () {
|
||||||
|
err=1
|
||||||
|
}
|
||||||
|
|
||||||
|
trap set_error ERR
|
||||||
|
|
||||||
|
system="$(nix eval --impure --raw --expr 'builtins.currentSystem')"
|
||||||
|
|
||||||
|
|
||||||
|
run_builds () {
|
||||||
|
for i in "$@" ; do
|
||||||
|
nix-fast-build --eval-workers 1 --no-nom --skip-cache --attic-cache main -f "$i"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
build_systems () {
|
||||||
|
case "$system" in
|
||||||
|
x86_64-linux) run_builds \
|
||||||
|
.\#nixosConfigurations.nullbox.config.system.build.toplevel \
|
||||||
|
.\#nixosConfigurations.slab.config.system.build.toplevel \
|
||||||
|
.\#nixosConfigurations.nixos-wsl.config.system.build.toplevel \
|
||||||
|
;;
|
||||||
|
|
||||||
|
aarch64-linux) run_builds \
|
||||||
|
.\#nixosConfigurations.rpi4.config.system.build.toplevel \
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
build_packages () {
|
||||||
|
run_builds .\#packages."${system}".redlib
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$#" -ne 0 ]] ; then
|
||||||
|
until [[ "$#" -le 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
pkgs|packages) DO_PACKAGES=1;;
|
||||||
|
config) DO_CONFIG=1;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
else
|
||||||
|
DO_PACKAGES=1
|
||||||
|
DO_CONFIG=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${DO_CONFIG:+x}" ]] ; then build_systems; fi
|
||||||
|
if [[ -n "${DO_PACKAGES:+x}" ]] ; then build_packages; fi
|
||||||
|
|
||||||
|
exit $err
|
Loading…
x
Reference in New Issue
Block a user