mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-02-04 17:23:19 +00:00
Refactor Android CI workflow to use Nix actions and improve translation file collection
Some checks failed
Android / build (push) Failing after 6m17s
Some checks failed
Android / build (push) Failing after 6m17s
This commit is contained in:
parent
49bc90c00c
commit
d1a4cd98cc
2 changed files with 73 additions and 19 deletions
50
.github/actions/nix-devshell/action.yml
vendored
Normal file
50
.github/actions/nix-devshell/action.yml
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
name: "nix-devshell"
|
||||
description:
|
||||
"Set up Nix, prebuild the devshell and run commands inside the devshell."
|
||||
inputs:
|
||||
prebuild:
|
||||
description:
|
||||
"Whether to prebuild the devshell (nix develop --command true)."
|
||||
required: false
|
||||
default: "false"
|
||||
commands:
|
||||
description:
|
||||
"Commands to run inside the devshell (executed with bash -lc)."
|
||||
required: false
|
||||
default: ""
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Install Nix (idempotent)
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if ! command -v nix >/dev/null 2>&1; then
|
||||
curl -L https://nixos.org/nix/install | sh -s -- --no-daemon
|
||||
fi
|
||||
# source the nix profile if present
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
nix --version
|
||||
|
||||
- name: Prebuild devshell
|
||||
if: ${{ inputs.prebuild == 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
nix --extra-experimental-features 'nix-command flakes' develop --command true
|
||||
|
||||
- name: Run commands in devshell
|
||||
if: ${{ inputs.commands != '' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
|
||||
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
|
||||
fi
|
||||
nix --extra-experimental-features 'nix-command flakes' develop --command bash -lc "${{ inputs.commands }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue