From c962c0f34b9bb1e61635aaf9de13718b41148cd5 Mon Sep 17 00:00:00 2001 From: Mason Malone <651224+MasonM@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:35:49 -0800 Subject: [PATCH] ci: don't redundantly install manifests/build binaries `make install` is being redundantly run three times for each E2E test: 1. In the workflow: https://github.com/argoproj/argo-workflows/blob/6699ab396f830210f6dcac4f00a9328a629c142f/.github/workflows/ci-build.yaml#L349-L350 2. As a prerequisite of `make start`: https://github.com/argoproj/argo-workflows/blob/6699ab396f830210f6dcac4f00a9328a629c142f/Makefile#L547o 3. As a dependency by Kit: https://github.com/argoproj/argo-workflows/blob/6699ab396f830210f6dcac4f00a9328a629c142f/tasks.yaml#L39 Similarly, the changes in https://github.com/argoproj/argo-workflows/pull/14012 to centralize binary building aren't effective because the binaries are being rebuilt. This eliminates the redundancy by removing the unnecessary prerequisites from the `Makefile` and the redundant `make install` step in `ci-build.yaml`. Also, I added `make --touch dist/*` to mark everything as up-to-date so the binaries aren't rebuilts (docs: https://www.gnu.org/software/make/manual/html_node/Instead-of-Execution.html) Signed-off-by: Mason Malone <651224+MasonM@users.noreply.github.com> --- .github/workflows/ci-build.yaml | 8 ++++---- .github/workflows/docs.yaml | 3 +++ Makefile | 6 +----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index d42bf0cee4aa..cf4207ec5eb2 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -280,8 +280,6 @@ jobs: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL printf "==> Available space after cleanup\n" df -h - - name: Install socat (needed by Kubernetes) - run: sudo apt-get -y install socat - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: @@ -300,6 +298,8 @@ jobs: with: python-version: '3.x' cache: pip + - name: Install socat (needed by Kubernetes) and kit + run: sudo apt-get -y install socat && make kit - name: Install and start K3S run: | if ! echo "${{ matrix.install_k3s_version }}" | egrep '^v[0-9]+\.[0-9]+\.[0-9]+\+k3s1$'; then @@ -339,6 +339,8 @@ jobs: with: name: cli path: dist/ + - name: Prepare binaries + run: chmod +x dist/* && make --touch dist/* - name: Set-up /etc/hosts run: | echo '127.0.0.1 dex' | sudo tee -a /etc/hosts @@ -346,8 +348,6 @@ jobs: echo '127.0.0.1 postgres' | sudo tee -a /etc/hosts echo '127.0.0.1 mysql' | sudo tee -a /etc/hosts echo '127.0.0.1 azurite' | sudo tee -a /etc/hosts - - name: Install manifests - run: make install PROFILE=${{matrix.profile}} STATIC_FILES=false - name: Start controller/API run: | make start PROFILE=${{matrix.profile}} \ diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 7df11be0449a..54157f925cd4 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -29,6 +29,9 @@ jobs: - uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1 with: node-version: "19" + # This is mainly here so the dependencies get saved to the cache by "actions/setup-go" + - name: Download go dependencies + run: go mod download # Use the same make target both locally and on CI to make it easier to debug failures. - name: Build & Lint docs run: make docs diff --git a/Makefile b/Makefile index 54ece57cc82a..bc4368ff4bed 100644 --- a/Makefile +++ b/Makefile @@ -541,11 +541,7 @@ endif .PHONY: start ifeq ($(RUN_MODE),local) -ifeq ($(API),true) -start: install controller kit cli -else -start: install controller kit -endif +start: kit else start: install kit endif