From c7c654ea33cd70314e774ca78bda09f62b24d010 Mon Sep 17 00:00:00 2001 From: mbushkov Date: Tue, 25 Jul 2023 19:27:28 +0200 Subject: [PATCH] Testing devenv within GitHub actions. --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 562ae29f7..0e22142ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,28 @@ env: GCS_LATEST_PATH: _latest_server_deb DOCKER_REPOSITORY: ghcr.io/google/grr jobs: - + test-devenv: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: check_deps + run: | + sudo apt-get update && sudo apt-get install -y podman curl jq + sudo usermod --add-subuids 500000-565535 --add-subgids 500000-565535 "${USER}" + devenv/devenv.sh check_deps + - name: start + run: | + devenv/devenv.sh start + OK=false + for attempt in $(seq 10); do + curl -su admin:admin http://localhost:4280/api/clients | + sed 1d | + jq -r ".items[].value.client_id.value" | + egrep -e "^C[.][0-9a-f]{16}\$" && { OK=true; break; } + echo "attempt ${attempt}: devenv not ready" + sleep 5 + done + [[ $OK = true ]] test-ubuntu: runs-on: ubuntu-22.04 env: