Skip to content

Commit

Permalink
added self-hosted arm runner and ubuntu 22.04 build
Browse files Browse the repository at this point in the history
  • Loading branch information
fspv committed Dec 10, 2024
1 parent c71050d commit 2c1aa2c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 11 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/nix-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ jobs:
build-ubuntu-24-04:
runs-on: ubuntu-24.04
steps:
- run: df -h
- name: "node-cleanup"
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
sudo docker builder prune -a
- run: df -h
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/nix-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,62 @@ jobs:
build-ubuntu-24-04:
runs-on: ubuntu-24.04
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Nix
uses: cachix/install-nix-action@v27
- name: Init user env
run: |
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update
./.local/share/bin/init-user-env.sh
- name: Install dependencies
run: |
nix-shell .config/nix/dev.nix --run "echo Nix initialised successfully!"
- name: Test bash
run: |
nix-shell .config/nix/dev.nix --run "bash -ic 'echo hello'"
- name: Test zsh
run: |
nix-shell .config/nix/dev.nix --run "zsh -ic 'echo hello'"
build-ubuntu-22-04:
runs-on: ubuntu-22.04
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Nix
uses: cachix/install-nix-action@v27
- name: Init user env
run: |
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update
./.local/share/bin/init-user-env.sh
- name: Install dependencies
run: |
nix-shell .config/nix/dev.nix --run "echo Nix initialised successfully!"
- name: Test bash
run: |
nix-shell .config/nix/dev.nix --run "bash -ic 'echo hello'"
- name: Test zsh
run: |
nix-shell .config/nix/dev.nix --run "zsh -ic 'echo hello'"
build-ubuntu-24-04-arm64:
runs-on: [self-hosted, linux, ARM64]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Nix
uses: cachix/install-nix-action@v27
- name: Init user env
run: |
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update
./.local/share/bin/init-user-env.sh
- name: Install dependencies
run: |
Expand Down
11 changes: 7 additions & 4 deletions .local/share/bin/init-user-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for path in "${!repos[@]}"; do
fi
done

if test -f /.dockerenv; then
if [[ -v GITHUB_ACTIONS ]] && test -f /.dockerenv; then
exit 0
fi

Expand All @@ -53,10 +53,13 @@ fi
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update

# shellcheck disable=SC2016
nix-shell -p krew git cacert --command 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" && krew update && krew install fuzzy get-all grep ktop neat stern tail tree access-matrix' --pure
if [ "$(uname -m)" = "x86_64" ]; then
# Not all plugins are available on aarch64 and kubectl is not really needed there now
# shellcheck disable=SC2016
nix-shell -p krew git cacert --command 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" && krew update && krew install fuzzy get-all grep ktop neat stern tail tree access-matrix' --pure
fi

if [ "$GITHUB_ACTIONS" != "true" ]; then
if [[ ! -v GITHUB_ACTIONS ]]; then
# Requires bubblewrap which doesn't work in GitHub Actions
nix-shell -p arduino-cli bubblewrap --command "arduino-cli core install arduino:avr" --pure
fi
Expand Down

0 comments on commit 2c1aa2c

Please sign in to comment.