diff --git a/.github/workflows/check-developer-experience.yml b/.github/workflows/check-developer-experience.yml index cacdb7f1..70d2aaf5 100644 --- a/.github/workflows/check-developer-experience.yml +++ b/.github/workflows/check-developer-experience.yml @@ -7,7 +7,8 @@ # Production artifacts are produced in a sterile environment (in another CI workflow). name: Developer Experience -on: [ push ] +on: + - push concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }} diff --git a/justfile b/justfile index 54b1383b..3b052961 100644 --- a/justfile +++ b/justfile @@ -114,7 +114,8 @@ compile-env *args: fill-out-dev-env-template declare tmp_link tmp_link="$(mktemp -p "$(pwd)/sterile" -d --suffix=dataplane-compile-env.link)" declare -r tmp_link - mkdir -p FAKE_HOME; + declare FAKE_HOME="$(pwd)/sterile/FAKE_HOME" + mkdir -p "${FAKE_HOME}" cleanup() { rm -r "${tmp_link}" rm -r FAKE_HOME @@ -131,7 +132,7 @@ compile-env *args: fill-out-dev-env-template --rm \ --name dataplane-compile-env \ --tmpfs "/tmp:uid=$(id -u),gid=$(id -g),nodev,noexec,nosuid" \ - --mount "type=bind,source=$(pwd)/FAKE_HOME,destination=/home/runner,bind-propagation=rprivate" \ + --mount "type=bind,source=${FAKE_HOME},destination=/home/${USER:-runner},bind-propagation=rprivate" \ --mount type=bind,source="$(pwd),destination=/work,bind-propagation=rprivate" \ --mount type=bind,source="${tmp_link},destination=/work/compile-env,bind-propagation=rprivate" \ --mount type=bind,source="$(pwd)/dev-env-template/etc/passwd,destination=/etc/passwd,readonly" \ @@ -281,10 +282,13 @@ fake-nix refake="": fill-out-dev-env-template: {{ _just_debuggable_ }} mkdir -p dev-env-template/etc + if [ -z "${UID:-}" ]; then + >&2 echo "ERROR: environment variable UID not set" + fi declare -rxi UID GID="$(id -g)" declare -rxi GID - declare -rx USER=runner + declare -rx USER="${USER:-runner}" envsubst < dev-env-template/etc.template/group.template > dev-env-template/etc/group envsubst < dev-env-template/etc.template/passwd.template > dev-env-template/etc/passwd